From: <avn...@us...> - 2008-05-29 18:06:20
|
Revision: 3102 http://urakawa.svn.sourceforge.net/urakawa/?rev=3102&view=rev Author: avneeshsingh Date: 2008-05-29 11:06:13 -0700 (Thu, 29 May 2008) Log Message: ----------- Added play heading phrase behaviour to play on navigate Modified Paths: -------------- trunk/urakawa/application/Obi/Obi/Playlist.cs trunk/urakawa/application/Obi/Obi/ProjectView/TransportBar.cs Modified: trunk/urakawa/application/Obi/Obi/Playlist.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/Playlist.cs 2008-05-29 14:06:35 UTC (rev 3101) +++ trunk/urakawa/application/Obi/Obi/Playlist.cs 2008-05-29 18:06:13 UTC (rev 3102) @@ -91,6 +91,23 @@ /// <summary> + /// If phrase node is passed as parameter, adds this phrase in playlist + /// else if section node is passed, add phrases of this section excluding child section to playlist + /// This is done independent of current selection + /// </summary> + /// <param name="player"></param> + /// <param name="node"></param> + public Playlist(AudioPlayer player,ObiNode node ) + { + mPlayer = player; + Reset(LocalPlaylist); + AddPhraseNodes(node); + } + + + + + /// <summary> /// Get the audio player for the playlist. Useful for setting up event listeners. /// </summary> public AudioPlayer Audioplayer { get { return mPlayer; } } Modified: trunk/urakawa/application/Obi/Obi/ProjectView/TransportBar.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/ProjectView/TransportBar.cs 2008-05-29 14:06:35 UTC (rev 3101) +++ trunk/urakawa/application/Obi/Obi/ProjectView/TransportBar.cs 2008-05-29 18:06:13 UTC (rev 3102) @@ -1718,6 +1718,8 @@ mCurrentPlaylist.Stop(); //if (mView.Selection.Node is PhraseNode) //PlayOrResume(); + if (mView.Selection.Node is SectionNode && mView.ObiForm.Settings.PlayOnNavigate) + PlayHeadingPhrase(mView.SelectedNodeAs<SectionNode>()); } else { @@ -1726,11 +1728,15 @@ } } } - if (mView.ObiForm.Settings.PlayOnNavigate - && - (mState == State.Paused || mState == State.Stopped ) - && mView.Selection.Node is PhraseNode ) - PlayOrResume () ; + if (mView.ObiForm.Settings.PlayOnNavigate + && + (mState == State.Paused || mState == State.Stopped)) + { + if (mView.Selection.Node is SectionNode) + PlayHeadingPhrase(mView.SelectedNodeAs<SectionNode>()); + else if (mView.Selection.Node is PhraseNode) + PlayOrResume(); + } }// end of selection null check } @@ -1746,14 +1752,18 @@ if (((EmptyNode)node.PhraseChild(i)).NodeKind == EmptyNode.Kind.Heading) { ENode = node.PhraseChild(i); - System.Media.SystemSounds.Asterisk.Play(); - break; + break; } } if (ENode is PhraseNode) { - PlayOrResume(node.PhraseChild(0)); + mLocalPlaylist = new Playlist(mPlayer, ENode); + SetPlaylistEvents(mLocalPlaylist); + mCurrentPlaylist = mLocalPlaylist; + mCurrentPlaylist.CurrentPhrase = (PhraseNode) ENode ; + mCurrentPlaylist.Play(); + //PlayOrResume(node.PhraseChild(0)); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |