From: <avn...@us...> - 2008-05-28 06:32:25
|
Revision: 3099 http://urakawa.svn.sourceforge.net/urakawa/?rev=3099&view=rev Author: avneeshsingh Date: 2008-05-27 23:32:17 -0700 (Tue, 27 May 2008) Log Message: ----------- Transition from play all to play selection and vice versa added during paused state. Modified Paths: -------------- trunk/urakawa/application/Obi/Obi/ObiForm.cs trunk/urakawa/application/Obi/Obi/ProjectView/TransportBar.cs Modified: trunk/urakawa/application/Obi/Obi/ObiForm.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/ObiForm.cs 2008-05-27 12:28:12 UTC (rev 3098) +++ trunk/urakawa/application/Obi/Obi/ObiForm.cs 2008-05-28 06:32:17 UTC (rev 3099) @@ -614,9 +614,9 @@ // Update the transport manu private void UpdateTransportMenu() { - mPlayToolStripMenuItem.Enabled = mProjectView.CanPlay || mProjectView.CanPlaySelection; - mPlayAllToolStripMenuItem.Enabled = mProjectView.CanPlay; - mPlaySelectionToolStripMenuItem.Enabled = mProjectView.CanPlaySelection; + mPlayToolStripMenuItem.Enabled = mProjectView.CanPlay || mProjectView.CanPlaySelection || mProjectView.CanResume ; + mPlayAllToolStripMenuItem.Enabled = mProjectView.CanPlay || mProjectView.CanResume; + mPlaySelectionToolStripMenuItem.Enabled = mProjectView.CanPlaySelection || mProjectView.CanResume ; if (mProjectView.CanResume) { mPauseToolStripMenuItem.Visible = false; Modified: trunk/urakawa/application/Obi/Obi/ProjectView/TransportBar.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/ProjectView/TransportBar.cs 2008-05-27 12:28:12 UTC (rev 3098) +++ trunk/urakawa/application/Obi/Obi/ProjectView/TransportBar.cs 2008-05-28 06:32:17 UTC (rev 3099) @@ -576,12 +576,24 @@ /// </summary> public void PlayAll() { - if (CanPlay) + if (CanPlay) { mCurrentPlaylist = mMasterPlaylist; PlayCurrentPlaylistFromSelection(); } - } + else if (CanResumePlayback) + { + if (mCurrentPlaylist != mMasterPlaylist) // if this is local playlist, start playing master playlist from the point where local playlist has paused + { + UpdateSelectionForPlayModeTransition(); + Thread.Sleep(200); + mCurrentPlaylist = mMasterPlaylist; + PlayCurrentPlaylistFromSelection(); + } + else + mCurrentPlaylist.Resume(); + } + } /// <summary> /// All-purpose play function for the play button. @@ -591,17 +603,38 @@ /// </summary> public void PlayOrResume() { - if (CanPlay) + if (CanPlay ) { - PlayOrResume(mView.Selection == null ? null : mView.Selection.Node); + PlayOrResume(mView.Selection == null ? null : mView.Selection.Node); } else if (CanResumePlayback) { + if (mCurrentPlaylist == mMasterPlaylist) // if this is master playlist, start playing local playlist from the point where master playlist is paused + { + UpdateSelectionForPlayModeTransition(); + Thread.Sleep(200); + PlayOrResume(mView.Selection == null ? null : mView.Selection.Node); + } + else mCurrentPlaylist.Resume(); } } + /// <summary> + /// Select currently playing phrase with current time and stops current playlist for transition to other playlist + /// </summary> + private void UpdateSelectionForPlayModeTransition() + { + PhraseNode PlaybackStartNode = mCurrentPlaylist.CurrentPhrase; + double StartTime = mCurrentPlaylist.CurrentTimeInAsset; + mCurrentPlaylist.Stop(); + mView.SelectedBlockNode = PlaybackStartNode; + mView.Selection = new AudioSelection((PhraseNode)mView.Selection.Node, mView.Selection.Control, + new AudioRange(StartTime)); + } + + /// <summary> /// Play a single node (phrase or section), or everything if the node is null /// (and the mPlayIfNoSelection flag is set.) /// </summary> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |