diff --git a/livesupport/products/gLiveSupport/src/LiveModeWindow.cxx b/livesupport/products/gLiveSupport/src/LiveModeWindow.cxx index 4ce390232..391198978 100644 --- a/livesupport/products/gLiveSupport/src/LiveModeWindow.cxx +++ b/livesupport/products/gLiveSupport/src/LiveModeWindow.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.18 $ + Version : $Revision: 1.19 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/LiveModeWindow.cxx,v $ ------------------------------------------------------------------------------*/ @@ -144,7 +144,7 @@ LiveModeWindow :: LiveModeWindow (Ptr::Ref gLiveSupport, outputPlayButton->signal_clicked().connect(sigc::mem_fun(*this, &LiveModeWindow::onOutputPlay )); - // create the right-click entry context menu for audio clips + // create the right-click entry context menu contextMenu = Gtk::manage(new Gtk::Menu()); Gtk::Menu::MenuList& contextMenuList = contextMenu->items(); // register the signal handlers for the popup menu diff --git a/livesupport/products/gLiveSupport/src/LiveModeWindow.h b/livesupport/products/gLiveSupport/src/LiveModeWindow.h index 1326834ce..b12ad8d9f 100644 --- a/livesupport/products/gLiveSupport/src/LiveModeWindow.h +++ b/livesupport/products/gLiveSupport/src/LiveModeWindow.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.13 $ + Version : $Revision: 1.14 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/LiveModeWindow.h,v $ ------------------------------------------------------------------------------*/ @@ -74,7 +74,7 @@ using namespace LiveSupport::Widgets; * playlists. * * @author $Author: fgerlits $ - * @version $Revision: 1.13 $ + * @version $Revision: 1.14 $ */ class LiveModeWindow : public WhiteWindow, public LocalizedObject { @@ -87,7 +87,7 @@ class LiveModeWindow : public WhiteWindow, public LocalizedObject * Lists one clip per row. * * @author $Author: fgerlits $ - * @version $Revision: 1.13 $ + * @version $Revision: 1.14 $ */ class ModelColumns : public PlayableTreeModelColumnRecord { @@ -159,6 +159,7 @@ class LiveModeWindow : public WhiteWindow, public LocalizedObject /** * Signal handler for the mouse clicked on one of the entries. + * This brings up the right-click context menu. * * @param event the button event recieved */ diff --git a/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx b/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx index 5c8e0c605..6accf1d98 100644 --- a/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx +++ b/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.19 $ + Version : $Revision: 1.20 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx,v $ ------------------------------------------------------------------------------*/ @@ -156,11 +156,11 @@ SimplePlaylistManagementWindow :: SimplePlaylistManagementWindow ( add(*mainBox); - // Register the signal handlers + // Register the signal handlers for the buttons saveButton->signal_clicked().connect(sigc::mem_fun(*this, - &SimplePlaylistManagementWindow::onSaveButtonClicked)); + &SimplePlaylistManagementWindow::onSaveButtonClicked)); closeButton->signal_clicked().connect(sigc::mem_fun(*this, - &SimplePlaylistManagementWindow::onCloseButtonClicked)); + &SimplePlaylistManagementWindow::onCloseButtonClicked)); // show set_name("simplePlaylistManagementWindow"); @@ -399,9 +399,12 @@ GLiveSupport :: setFadeIn(Ptr::Ref playlistElement, } else { oldFadeOut.reset(new time_duration(0,0,0,0)); } + Ptr::Ref newFadeInfo(new FadeInfo( newFadeIn, oldFadeOut )); - playlistElement->setFadeInfo(newFadeInfo); + if (isLengthOkay(playlistElement, newFadeInfo)) { + playlistElement->setFadeInfo(newFadeInfo); + } } @@ -422,6 +425,22 @@ GLiveSupport :: setFadeOut(Ptr::Ref playlistElement, } Ptr::Ref newFadeInfo(new FadeInfo( oldFadeIn, newFadeOut )); - playlistElement->setFadeInfo(newFadeInfo); + if (isLengthOkay(playlistElement, newFadeInfo)) { + playlistElement->setFadeInfo(newFadeInfo); + } +} + + +/*------------------------------------------------------------------------------ + * Auxilliary function: check that fades are not longer than the whole clip. + *----------------------------------------------------------------------------*/ +inline bool +GLiveSupport :: isLengthOkay(Ptr::Ref playlistElement, + Ptr::Ref newFadeInfo) + throw() +{ + time_duration totalFades = *newFadeInfo->getFadeIn() + + *newFadeInfo->getFadeOut(); + return (totalFades < *playlistElement->getPlayable()->getPlaylength()); } diff --git a/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.h b/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.h index 30ca7187a..0dad2d98f 100644 --- a/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.h +++ b/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.9 $ + Version : $Revision: 1.10 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.h,v $ ------------------------------------------------------------------------------*/ @@ -87,7 +87,7 @@ using namespace LiveSupport::Widgets; * * * @author $Author: fgerlits $ - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ */ class SimplePlaylistManagementWindow : public WhiteWindow, public LocalizedObject @@ -116,7 +116,7 @@ class SimplePlaylistManagementWindow : public WhiteWindow, * Lists one playlist entry per row. * * @author $Author: fgerlits $ - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ */ class ModelColumns : public ZebraTreeModelColumnRecord { @@ -287,6 +287,14 @@ class SimplePlaylistManagementWindow : public WhiteWindow, setFadeOut(Ptr::Ref playlistElement, Ptr::Ref newFadeOut) throw(); + /** + * Auxilliary function: check that fades are not longer than + * the whole clip. + */ + bool + isLengthOkay(Ptr::Ref playlistElement, + Ptr::Ref newFadeInfo) throw(); + } // namespace GLiveSupport } // namespace LiveSupport