示例#1
0
 public Copy(ProjectView.ProjectView view, PhraseNode node, AudioRange range)
     : base(view)
 {
     mOldClipboard = view.Clipboard;
     mNewClipboard = new AudioClipboard(node, range);
     SetDescriptions(Localizer.Message("copy_audio"));
 }
示例#2
0
 /// <summary>
 /// Create a new cursor when playback starts.
 /// </summary>
 public void InitCursor(double time)
 {
     mCursor = new AudioRange(time);
     if (mNeedsRendering)
     {
         mBlock.PrioritizeRendering(AudioBlock.WAVEFORM_SELECTED_PRIORITY);
     }
 }
示例#3
0
        //@zoomwaveform
        public void MarkSelection(int x)
        {
            if (mWaveform != null)
            {
                int        waveformX      = x - this.Margin.Left - mWaveform.Left;
                double     tempTime       = mWaveform.TimeFromX(waveformX);
                AudioRange tempAudioRange = new AudioRange(tempTime);
                PhraseNode tempNode       = (PhraseNode)Node;
                ContentView.SelectCursor(tempNode, tempAudioRange);

                mWaveform.SelectionPointPosition = waveformX;
            }
        }
示例#4
0
        private System.Threading.Mutex mPaintMutex; // for forcing mutual exclusion in on paint event

        /// <summary>
        /// Create a waveform with no data to display yet.
        /// </summary>
        public Waveform()
        {
            InitializeComponent();
            this.Disposed      += new EventHandler(Waveform_Disposed);
            DoubleBuffered      = true;
            mBitmap             = null;
            mBitmap_Highlighted = null;
            mBlock              = null;
            mSelection          = null;
            mNeedsRendering     = false;
            mPaintMutex         = new System.Threading.Mutex();
            m_WaveformStartTime = -1;
            m_WaveformEndTime   = -1;
        }
    /// <summary>
    /// Returns the average float value for samples over audio range "range"
    /// </summary>
    /// <param name="range"></param>
    /// <returns></returns>
    public static float getRawAudioRange(AudioRange range)
    {
        switch (range)
        {
        case AudioRange.SubBass:
            return(instance.bandValues[0]);

        case AudioRange.Bass:
            return(instance.bandValues[1]);

        case AudioRange.LowMid:
            return(instance.bandValues[2]);

        case AudioRange.Mid:
            return(instance.bandValues[3]);

        case AudioRange.UpperMid:
            return(instance.bandValues[4]);

        case AudioRange.Presence:
            return(instance.bandValues[5]);

        case AudioRange.Brilliance:
            return(instance.bandValues[6]);

        case AudioRange.SuperBrilliance:
            return(instance.bandValues[7]);

        /*
         * case AudioRange.Beat:
         *  if (instance.checkBeat())
         *      return 1;
         *  else
         *      return 0;
         */
        default:
            return(0);
        }
    }
示例#6
0
 /// <summary>
 /// Playback cursor leaves the waveform.
 /// </summary>
 public void ClearCursor()
 {
     mCursor = null;
     Invalidate();
 }
示例#7
0
 /// <summary>
 /// Clear the current selection in the waveform.
 /// </summary>
 public void Deselect()
 {
     mSelection = null;
     Invalidate();
 }
 /// <summary>
 /// Show the cursor at the current time in the waveform of the current playing block.
 /// </summary>
 public void SetSelectedAudioInBlockFromBlock(Block block, AudioRange audioRange)
 {
     mContentView.SelectionFromStrip = new AudioSelection((PhraseNode)block.Node, mContentView, audioRange);
 }