当前位置: 首页>>代码示例>>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;未经允许,请勿转载。