Changeset 7426


Ignore:
Timestamp:
12/07/17 10:10:45 (20 months ago)
Author:
rohit_tandon
Message:

-Time Elapsed will also be displayed when player is active.
-When audio in a single phrase is selected and begin and end marking is done on that selected part then Time elapsed will be the selected part duration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Obi/Obi/ProjectView/ProjectView.cs

    r7424 r7426  
    4343        private bool m_SaveZoomWaveformZoomLevel; 
    4444        private double m_TotalCursorTime; // use to calulate time between two marks. 
     45        private PhraseNode m_BeginMarkPhraseWhenPlayerIsActive; // use to get begin mark phrase when player is active for time elapsed calculations. 
     46        private PhraseNode m_EndMarkPhraseWhenPlayerIsActive; // use to get end mark phrase when player is active for time elapsed calculations. 
    4547                   
    4648     
     
    52745276 
    52755277            m_TotalCursorTime = 0; 
    5276             if (this.Selection != null && this.Selection is AudioSelection && ((AudioSelection)this.Selection).AudioRange != null) 
     5278            m_BeginMarkPhraseWhenPlayerIsActive = null; 
     5279            if (this.Selection != null && this.Selection is AudioSelection && ((AudioSelection)this.Selection).AudioRange != null && !TransportBar.IsPlayerActive) 
    52775280            { 
    52785281                if (((AudioSelection)this.Selection).AudioRange.HasCursor) 
     
    52865289                m_TotalCursorTime = this.Selection.Node.Duration - m_TotalCursorTime; 
    52875290            } 
    5288             else if (this.Selection != null && this.Selection.Node != null) 
     5291            else if (this.Selection != null && this.Selection.Node != null && !TransportBar.IsPlayerActive) 
    52895292            { 
    52905293                m_TotalCursorTime = this.Selection.Node.Duration; 
    52915294            } 
    5292        
     5295            else if (this.TransportBar.IsPlayerActive) 
     5296            { 
     5297                m_TotalCursorTime = TransportBar.CurrentPlaylist.CurrentPhrase.Duration - TransportBar.CurrentPlaylist.CurrentTimeInAsset; 
     5298                m_BeginMarkPhraseWhenPlayerIsActive = TransportBar.CurrentPlaylist.CurrentPhrase; 
     5299            } 
     5300             
    52935301           TransportBar.PlayAudioClue(TransportBar.AudioCluesSelection.SelectionBegin); 
    52945302        } 
     
    52985306            if (mContentView.BeginSpecialNode == null) return; 
    52995307            mContentView.EndSpecialNode = Selection.EmptyNodeForSelection; //@AssociateNode 
    5300             if (this.Selection != null && this.Selection is AudioSelection && ((AudioSelection)this.Selection).AudioRange != null) 
     5308 
     5309            m_EndMarkPhraseWhenPlayerIsActive = null; 
     5310            if (this.Selection != null && this.Selection is AudioSelection && ((AudioSelection)this.Selection).AudioRange != null && !TransportBar.IsPlayerActive) 
    53015311            { 
    53025312                if (((AudioSelection)this.Selection).AudioRange.HasCursor) 
     
    53045314                    m_TotalCursorTime += m_TotalCursorTime = ((AudioSelection)this.Selection).AudioRange.CursorTime; 
    53055315                } 
     5316                else if (mContentView.BeginSpecialNode == mContentView.EndSpecialNode) 
     5317                { 
     5318                    m_TotalCursorTime = ((AudioSelection)this.Selection).AudioRange.SelectionEndTime - ((AudioSelection)this.Selection).AudioRange.SelectionBeginTime; 
     5319                } 
     5320                else  
     5321                { 
     5322                    m_TotalCursorTime += m_TotalCursorTime = ((AudioSelection)this.Selection).AudioRange.SelectionEndTime; 
     5323                } 
     5324                
     5325            } 
     5326            else if (this.Selection != null && this.Selection.Node != null && !TransportBar.IsPlayerActive) 
     5327            { 
     5328                m_TotalCursorTime += this.Selection.Node.Duration; 
     5329            } 
     5330            else if(this.TransportBar.IsPlayerActive) 
     5331            { 
     5332                m_EndMarkPhraseWhenPlayerIsActive = TransportBar.CurrentPlaylist.CurrentPhrase; 
     5333                if (m_BeginMarkPhraseWhenPlayerIsActive == m_EndMarkPhraseWhenPlayerIsActive) 
     5334                { 
     5335                    double tempTime = TransportBar.CurrentPlaylist.CurrentPhrase.Duration - TransportBar.CurrentPlaylist.CurrentTimeInAsset; 
     5336                    m_TotalCursorTime = m_TotalCursorTime - tempTime; 
     5337                } 
    53065338                else 
    53075339                { 
    5308                     m_TotalCursorTime += m_TotalCursorTime = ((AudioSelection)this.Selection).AudioRange.SelectionEndTime; 
    5309                 } 
    5310             } 
    5311             else if (this.Selection != null && this.Selection.Node != null) 
    5312             { 
    5313                 m_TotalCursorTime += this.Selection.Node.Duration; 
     5340                    m_TotalCursorTime += TransportBar.CurrentPlaylist.CurrentTimeInAsset; 
     5341                } 
     5342                 
    53145343            } 
    53155344            TransportBar.PlayAudioClue(TransportBar.AudioCluesSelection.SelectionEnd); 
     
    53585387                    RenumberPage(); 
    53595388                else if (AssignSpecialNodeDialog.IsTimeElapsedChecked) 
    5360                     TimeElasped(startNode,endNode); 
     5389                { 
     5390                    if (m_BeginMarkPhraseWhenPlayerIsActive != null) 
     5391                    { 
     5392                        startNode = m_BeginMarkPhraseWhenPlayerIsActive; 
     5393                    } 
     5394                    if (m_EndMarkPhraseWhenPlayerIsActive != null) 
     5395                    { 
     5396                        endNode = m_EndMarkPhraseWhenPlayerIsActive; 
     5397                    } 
     5398                    TimeElasped(startNode, endNode); 
     5399                } 
    53615400                else if (AssignSpecialNodeDialog.IsAudioProcessingChecked) 
    53625401                { 
     
    69877026                    { 
    69887027                        phraseNode = (PhraseNode)startNode; 
     7028                        Console.WriteLine("Start Phrase selected is <<<<<<<<<<<<<<<<<<<<< {0}", phraseNode); 
    69897029                    } 
    69907030                    else if(startNode is EmptyNode) 
     
    70087048                    { 
    70097049                        phraseEndNode = (PhraseNode)endNode; 
     7050                        Console.WriteLine("End Phrase selected is <<<<<<<<<<<<<<<<<<<<< {0}", phraseEndNode); 
    70107051                    } 
    70117052                    else if (endNode is EmptyNode) 
Note: See TracChangeset for help on using the changeset viewer.