当前位置: 首页>>代码示例>>PHP>>正文


PHP Kit::getKitChannels方法代码示例

本文整理汇总了PHP中Kit::getKitChannels方法的典型用法代码示例。如果您正苦于以下问题:PHP Kit::getKitChannels方法的具体用法?PHP Kit::getKitChannels怎么用?PHP Kit::getKitChannels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Kit的用法示例。


在下文中一共展示了Kit::getKitChannels方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: header

        $renameSuccess = $kitAPI->updateKitName($_POST['id'], $_POST['kitName']);
        if (!$renameSuccess['success']) {
            $renameMesg = $renameSuccess['mesg'];
            $skipRedirect = true;
        }
    }
    for ($n = 0; $n < MAX_CHANNELS; $n++) {
        $kitAPI->updateKitChannel($_POST['id'], $_POST['channelId'][$n], $_POST['channelName'][$n], $_POST['channelOgg'][$n], $_POST['channelMp3'][$n]);
    }
    if (!$skipRedirect) {
        header('Location: ../');
    }
}
if ($_GET) {
    $id = $_GET['id'];
    $kitChArr = $kitAPI->getKitChannels($id);
    if ($kitChArr) {
        $tableStr = "\n            <div class='contentBlock' style='width: 400px;'>\n                <div class='contentBlockHeader'>\n                    {$kitName}\n                </div>\n                <div id='kitBlock' class='contentBlockBody'>\n                    <span class='label'>Kit Name:</span><br />\n                    <input type='text' name='kitName' value='{$kitName}' /><span class='error'>{$renameMesg}</span><br /><br />\n                    <table>\n                        <tr>\n                            <th>Channel</th>\n                            <th>Name</th>\n                            <th></th>\n                            <th></th>\n                            <th></th>\n                        </tr>";
        for ($n = 0; $n < MAX_CHANNELS; $n++) {
            $tableStr .= "\n                            <tr>\n                                <td>\n                                    <select name='channelId[{$n}]' value='" . $n . "'>";
            for ($m = 0; $m < MAX_CHANNELS; $m++) {
                if ($n == $m) {
                    $default = "selected='selected'";
                } else {
                    $default = "";
                }
                $tableStr .= "<option value='{$m}' {$default}>{$m} - " . $keyMapArr[$m] . "</option>";
            }
            $tableStr .= "\n                                    </select>\n                                </td><td>\n                                    <input type='text' id='channelName" . $n . "' name='channelName[{$n}]' value='" . $kitChArr[$n]['name'] . "' />\n                                </td>\n                                <td>\n                                    <iframe name='uploadTarget" . $n . "' src='#'></iframe>\n                                    <div class='uploadFormWrapper'>\n                                        <form method='post' id='frmUpload" . $n . "' enctype='multipart/form-data' target='uploadTarget" . $n . "'>\n                                            <input type='file' class='file' name='uploadedFile' id='uploadedFile" . $n . "' onchange='doUpload(" . $n . ", this);' title='Upload' />\n                                            <input type='button' id='cmdUpload" . $n . "' value='Upload' />\n                                            <img src='../../../includes/images/ajax-loader.gif' style='display: none;' id='imgLoader" . $n . "' />\n                                        </form>\n                                    </div>\n\n                                    <textarea name='channelOgg[{$n}]' id='channelOgg" . $n . "' style='display: none;'>" . $kitChArr[$n]['ogg'] . "</textarea>\n                                    <textarea name='channelMp3[{$n}]' id='channelMp3" . $n . "' style='display: none;'>" . $kitChArr[$n]['mp3'] . "</textarea>\n                                </td>\n                                <td>";
            if ($kitChArr[$n]['ogg'] || $kitChArr[$n]['mp3']) {
                $soundExists = "";
开发者ID:htmiguel,项目名称:beat-slappr,代码行数:31,代码来源:index.php

示例2: Kit

#!/usr/bin/php
<?php 
/******************************************************************/
/***KIT SYNC SCRIPT - TO BE RUN FROM CLI AND FROM APP ROOT PATH!***/
/******************************************************************/
require_once "config.php";
require_once "api/classes/kit.inc.php";
$kitAPI = new Kit();
$downloadDir = "download/kits/";
$kitArr = $kitAPI->getKits();
foreach ($kitArr as $key => $val) {
    $kitId = $val['id'];
    $kitChannels = $kitAPI->getKitChannels($kitId, 'ogg');
    mkdir($downloadDir . $kitId);
    $channelArr = array();
    foreach ($kitChannels as $key => $val) {
        $fileName = $downloadDir . $kitId . '/' . $val['channel'] . '.ogg';
        $fp = fopen($fileName, 'wb');
        fwrite($fp, base64_decode($val['src']));
        fclose($fp);
        $channel = exec("soxi -c " . $fileName);
        array_push($channelArr, $channel);
    }
    $maxChannels = max($channelArr);
    if ($maxChannels > 1) {
        foreach ($channelArr as $key => $val) {
            if ($val == 1) {
                $fileName = $downloadDir . $kitId . '/' . $key . ".ogg";
                exec("sox " . $fileName . " " . $fileName . " remix 1 1");
            }
        }
开发者ID:htmiguel,项目名称:beat-slappr,代码行数:31,代码来源:kit-sync.php

示例3:

if (isset($_REQUEST['cmd'])) {
    $cmd = $_REQUEST['cmd'];
}
if (isset($_REQUEST['id'])) {
    $id = $_REQUEST['id'];
}
if (isset($_REQUEST['format'])) {
    $format = $_REQUEST['format'];
}
if (!isset($cmd)) {
    echo "No command specified.";
    return;
}
switch ($cmd) {
    case "getKits":
        $kits = $kit->getKits();
        echo json_encode($kits);
        break;
    case "getKitChannels":
        if (isset($id) && isset($format)) {
            $channels = $kit->getKitChannels($id, $format);
            echo json_encode($channels);
        } else {
            echo "Missing Required Parameters";
            return;
        }
        break;
    default:
        echo "That command is not implemented.";
        return;
}
开发者ID:htmiguel,项目名称:beat-slappr,代码行数:31,代码来源:kit.php


注:本文中的Kit::getKitChannels方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。