當前位置: 首頁>>代碼示例>>C#>>正文


C# ChannelType.ToString方法代碼示例

本文整理匯總了C#中ChannelType.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# ChannelType.ToString方法的具體用法?C# ChannelType.ToString怎麽用?C# ChannelType.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ChannelType的用法示例。


在下文中一共展示了ChannelType.ToString方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetChannelLevel

    /// <summary>
    /// Get the DB attenuation of the channel.
    /// </summary>
    /// <param name="channeltype">Channeltype.</param>
    public float GetChannelLevel(ChannelType channeltype)
    {
        ChannelInfo chInfo = null;
        channelInfos.TryGetValue(channeltype.ToString(), out chInfo);

        if(chInfo != null)
        {
            // !!! check with Andrea whether to return defaultDBLevel OR settedDBLevel
            return (chInfo.settedDBLevel);
        }
        else
        {
            Debug.LogError("Channelinfo not found");
            return 0.0f;
        }
    }
開發者ID:PaulElmo,項目名稱:Listen_In-Backup-,代碼行數:20,代碼來源:SoundManager.cs

示例2: BuildRecordingBaseFilePath

        public static string BuildRecordingBaseFilePath(string format, string channelDisplayName, ChannelType channelType, string scheduleName,
            string title, string programTitle, string subTitle, string episodeNumberDisplay, int? episodeNumber, int? seriesNumber, DateTime startTime, string category)
        {
            LimitLength(ref title, 80);
            LimitLength(ref programTitle, 80);
            LimitLength(ref scheduleName, 80);
            LimitLength(ref subTitle, 80);

            format = MakeValidPath(format).Replace(":", String.Empty).TrimStart('\\').TrimStart('/').TrimEnd('\\').TrimEnd('/');
            StringBuilder result = new StringBuilder(format);
            ReplaceFormatVariable(result, "%%CHANNEL%%", channelDisplayName);
            ReplaceFormatVariable(result, "%%CHANNELTYPE%%", channelType.ToString());
            ReplaceFormatVariable(result, "%%TVCHANNEL%%", channelDisplayName); // For backwards compatibility.
            ReplaceFormatVariable(result, "%%SCHEDULE%%", scheduleName);
            ReplaceFormatVariable(result, "%%TITLE%%", title);
            ReplaceFormatVariable(result, "%%LONGTITLE%%", programTitle);
            ReplaceFormatVariable(result, "%%EPISODETITLE%%", String.IsNullOrEmpty(subTitle) ? "#" : subTitle);
            ReplaceFormatVariable(result, "%%EPISODENUMBERDISPLAY%%", String.IsNullOrEmpty(episodeNumberDisplay) ? "#" : episodeNumberDisplay);
            ReplaceFormatVariable(result, "%%EPISODENUMBER%%", episodeNumber.HasValue ? episodeNumber.ToString() : "#");
            ReplaceFormatVariable(result, "%%EPISODENUMBER2%%", episodeNumber.HasValue ? episodeNumber.Value.ToString("00") : "00");
            ReplaceFormatVariable(result, "%%EPISODENUMBER3%%", episodeNumber.HasValue ? episodeNumber.Value.ToString("000") : "000");
            ReplaceFormatVariable(result, "%%SERIES%%", seriesNumber.HasValue ? seriesNumber.ToString() : "#");
            ReplaceFormatVariable(result, "%%SERIES2%%", seriesNumber.HasValue ? seriesNumber.Value.ToString("00") : "00");
            ReplaceFormatVariable(result, "%%DATE%%", startTime.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture));
            ReplaceFormatVariable(result, "%%YEAR%%", startTime.ToString("yyyy", CultureInfo.InvariantCulture));
            ReplaceFormatVariable(result, "%%MONTH%%", startTime.ToString("MM", CultureInfo.InvariantCulture));
            ReplaceFormatVariable(result, "%%DAY%%", startTime.ToString("dd", CultureInfo.InvariantCulture));
            ReplaceFormatVariable(result, "%%DAYOFWEEK%%", startTime.ToString("ddd", CultureInfo.CurrentCulture));
            ReplaceFormatVariable(result, "%%HOURS%%", startTime.ToString("HH", CultureInfo.InvariantCulture));
            ReplaceFormatVariable(result, "%%HOURS12%%", startTime.ToString("hhtt", CultureInfo.InvariantCulture));
            ReplaceFormatVariable(result, "%%MINUTES%%", startTime.ToString("mm", CultureInfo.InvariantCulture));
            ReplaceFormatVariable(result, "%%CATEGORY%%", String.IsNullOrEmpty(category) ? "#" : category);
            return result.ToString().Replace(".\\", "\\").Replace("./", "/");
        }
開發者ID:ncoH,項目名稱:ARGUS-TV-Clients,代碼行數:34,代碼來源:Utility.cs

示例3: Play

    /// <summary>
    /// Play the specified audioClip on specified channel type. This function is meant to be used for single sound occurences.
    /// Use default level will set the attenuation to its default level.
    /// </summary>
    /// <param name="audioClip">Audio clip.</param>
    /// <param name="clipName">Clip name.</param>
    /// <param name="channeltype">Channeltype.</param>
    public void Play(AudioClip audioClip, ChannelType channeltype, AudioClipInfo clipInfo)
    {
        GameObject go = new GameObject("GameSound");
        go.tag = channeltype.ToString();
        go.transform.SetParent(gameObject.transform, false);
        AudioSource source = go.AddComponent<AudioSource>();
        source.playOnAwake = false;

        source.clip = audioClip;

        float lvl = 0.0f;
        ChannelInfo chInfo = null;
        channelInfos.TryGetValue(channeltype.ToString(), out chInfo);

        if(chInfo != null)
        {
            lvl = clipInfo.useDefaultDBLevel ? chInfo.defaultDBLevel : chInfo.settedDBLevel;
        }
        else
        {
            Debug.LogError("Channel info not found");
        }

        audioMixer.SetFloat(channeltype.ToString(),lvl);
        source.outputAudioMixerGroup = chInfo.audioMixerGroup;

        source.loop = clipInfo.isLoop;

        source.PlayDelayed(clipInfo.delayAtStart);
        playingList.Add(go);
    }
開發者ID:PaulElmo,項目名稱:Listen_In-Paul-,代碼行數:38,代碼來源:SoundManager.cs

示例4: Stop

    /// <summary>
    /// Stop all the clips being played in a particular channel.
    /// </summary>
    /// <param name="channel">Channel.</param>
    public void Stop(ChannelType channel)
    {
        GameObject[] soundsInChannel = GameObject.FindGameObjectsWithTag(channel.ToString());

        for (int i = 0; i < soundsInChannel.Length; i++) {
            if(soundsInChannel[i].GetComponent<AudioSource>().isPlaying)
            {
                soundsInChannel[i].GetComponent<AudioSource>().Stop();
            }
        }
    }
開發者ID:PaulElmo,項目名稱:Listen_In-Paul-,代碼行數:15,代碼來源:SoundManager.cs

示例5: SetChannelLevel

    /// <summary>
    /// Sets the DB attenuation of the channel.
    /// </summary>
    /// <param name="channeltype">Channeltype.</param>
    /// <param name="value">Value.</param>
    public void SetChannelLevel(ChannelType channeltype, float value)
    {
        ChannelInfo chInfo = null;
        channelInfos.TryGetValue(channeltype.ToString(), out chInfo);

        if(chInfo != null)
        {
            chInfo.settedDBLevel = value;
        }
        else
        {
            Debug.LogError("Channelinfo not found");
        }
    }
開發者ID:PaulElmo,項目名稱:Listen_In-Paul-,代碼行數:19,代碼來源:SoundManager.cs


注:本文中的ChannelType.ToString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。