2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -04:00
|
|
|
Copyright (C) 2003 Paul Davis
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ardour_visual_time_axis_h__
|
|
|
|
#define __ardour_visual_time_axis_h__
|
|
|
|
|
2005-11-28 23:41:15 -05:00
|
|
|
#include <gtkmm/box.h>
|
|
|
|
#include <gtkmm/button.h>
|
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
#include <gtkmm2ext/selector.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#include "ardour_dialog.h"
|
|
|
|
#include "route_ui.h"
|
|
|
|
#include "enums.h"
|
|
|
|
#include "time_axis_view.h"
|
2005-11-15 21:57:22 -05:00
|
|
|
#include "canvas.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
namespace ARDOUR
|
|
|
|
{
|
|
|
|
class Session ;
|
|
|
|
}
|
|
|
|
|
|
|
|
class PublicEditor;
|
|
|
|
class ImageFrameView;
|
|
|
|
class ImageFrameTimeAxisView;
|
|
|
|
class MarkersTimeAxisView;
|
|
|
|
class TimeSelection;
|
2006-07-31 23:23:35 -04:00
|
|
|
class RegionSelection;
|
2005-09-25 14:42:24 -04:00
|
|
|
class MarkerTimeAxis;
|
|
|
|
class TimeAxisViewStrip;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Base Abstact Class for TimeAxis views that operate purely within the visual domain.
|
2009-10-14 12:10:01 -04:00
|
|
|
*
|
2005-09-25 14:42:24 -04:00
|
|
|
* This class provides many of the common methods required for visual TimeAxis views. The aim is
|
|
|
|
* to provide an abstract layer during the developmnt of the visual based time axis'. Many of these
|
2009-10-14 12:10:01 -04:00
|
|
|
* methods have a better home further up the class heirarchy, and in fact some are replication of
|
2005-09-25 14:42:24 -04:00
|
|
|
* methods found within RouteUI. This, however, has been required due to various problems with previous
|
|
|
|
* versions of g++, mainly 2.95, which are not correctly handling virtual methods, virtual base classes,
|
|
|
|
* and virtual methods when used with Multiple Inheritance. Perhaps these could be combined once the
|
|
|
|
* compilers all agree on hos do to do stuff...
|
2009-10-14 12:10:01 -04:00
|
|
|
*/
|
2005-09-25 14:42:24 -04:00
|
|
|
class VisualTimeAxis : public TimeAxisView
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// Constructor / Desctructor
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* VisualTimeAxis Destructor
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
virtual ~VisualTimeAxis() ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// Name/Id Accessors/Mutators
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Returns the name of this TimeAxis
|
|
|
|
*
|
|
|
|
* @return the name of this TimeAxis
|
|
|
|
*/
|
|
|
|
virtual std::string name() const ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Sets the name of this TimeAxis
|
|
|
|
*
|
|
|
|
* @param name the new name of this TimeAxis
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
*/
|
2009-10-01 21:49:57 -04:00
|
|
|
virtual void set_time_axis_name(const std::string & name, void* src) ;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// ui methods & data
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Sets the height of this TrackView to one of the defined TrackHeghts
|
|
|
|
*
|
2008-09-10 11:03:30 -04:00
|
|
|
* @param h the number of pixels to set the height to
|
2005-09-25 14:42:24 -04:00
|
|
|
*/
|
2009-10-14 12:10:01 -04:00
|
|
|
virtual void set_height (uint32_t);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// Selection Methods
|
|
|
|
// selection methods are not handled by visual time axis object yet...
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Not implemented
|
|
|
|
*/
|
2006-07-31 23:23:35 -04:00
|
|
|
virtual void set_selected_regionviews(RegionSelection&) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------//
|
|
|
|
// Emitted Signals
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Emitted when we have changed the gui, and what we have shanged
|
|
|
|
*/
|
2009-10-01 21:49:57 -04:00
|
|
|
sigc::signal<void,const std::string &,void*> gui_changed ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Emitted when this Visual Time Axis has been removed
|
2009-12-22 15:21:43 -05:00
|
|
|
* This is different to the CatchDeletion signal in that this signal
|
2005-09-25 14:42:24 -04:00
|
|
|
* is emitted during the deletion of this Time Axis, and not during
|
|
|
|
* the destructor, this allows us to capture the source of the deletion
|
|
|
|
* event
|
|
|
|
*/
|
2009-10-01 21:49:57 -04:00
|
|
|
sigc::signal<void,const std::string &,void*> VisualTimeAxisRemoved ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Emitted when we have changed the name of this TimeAxis
|
|
|
|
*/
|
2009-10-01 21:49:57 -04:00
|
|
|
sigc::signal<void,const std::string &,const std::string &,void*> NameChanged ;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Emitted when this time axis has been selected for removal
|
|
|
|
*/
|
2009-10-01 21:49:57 -04:00
|
|
|
//sigc::signal<void,std::std::string,void*> VisualTimeAxisRemoved ;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// Constructor / Desctructor
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Abstract Constructor for base visual time axis classes
|
|
|
|
*
|
|
|
|
* @param name the name/Id of thie TimeAxis
|
|
|
|
* @param ed the Ardour PublicEditor
|
|
|
|
* @param sess the current session
|
|
|
|
* @param canvas the parent canvas object
|
|
|
|
*/
|
2009-12-17 13:24:23 -05:00
|
|
|
VisualTimeAxis(const std::string & name, PublicEditor& ed, ARDOUR::Session* sess, ArdourCanvas::Canvas& canvas) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// Handle time axis removal
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handles the Removal of this VisualTimeAxis
|
|
|
|
*
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
*/
|
|
|
|
virtual void remove_this_time_axis(void* src) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Callback used to remove this time axis during the gtk idle loop
|
|
|
|
* This is used to avoid deleting the obejct while inside the remove_this_time_axis
|
|
|
|
* method
|
|
|
|
*
|
|
|
|
* @param ta the VisualTimeAxis to remove
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
*/
|
|
|
|
static gint idle_remove_this_time_axis(VisualTimeAxis* ta, void* src) ;
|
|
|
|
|
2009-10-14 12:10:01 -04:00
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// ui methods & data
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the visuals button click
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void visual_click() ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handle the hide buttons click
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void hide_click() ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Allows the selection of a new color for this TimeAxis
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
virtual void select_track_color() ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Provides a color chooser for the selection of a new time axis color.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
bool choose_time_axis_color() ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Sets the color of this TimeAxis to the specified color c
|
|
|
|
*
|
|
|
|
* @param c the new TimeAxis color
|
|
|
|
*/
|
2005-10-05 09:48:09 -04:00
|
|
|
void set_time_axis_color(Gdk::Color c) ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// Handle TimeAxis rename
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Construct a new prompt to receive a new name for this TimeAxis
|
|
|
|
*
|
|
|
|
* @see finish_time_axis_rename()
|
|
|
|
*/
|
|
|
|
void start_time_axis_rename() ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Handles the new name for this TimeAxis from the name prompt
|
|
|
|
*
|
|
|
|
* @see start_time_axis_rename()
|
|
|
|
*/
|
|
|
|
virtual void label_view() ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
2009-10-14 12:10:01 -04:00
|
|
|
// Handle name entry signals
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void name_entry_changed() ;
|
2010-05-31 10:21:43 -04:00
|
|
|
bool name_entry_focus_out_handler(GdkEventFocus*) ;
|
|
|
|
bool name_entry_key_release_handler(GdkEventKey*) ;
|
|
|
|
bool name_entry_button_release_handler(GdkEventButton*) ;
|
|
|
|
bool name_entry_button_press_handler(GdkEventButton*) ;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// VisualTimeAxis Widgets
|
|
|
|
Gtk::HBox other_button_hbox ;
|
|
|
|
Gtk::Button hide_button ;
|
|
|
|
Gtk::Button visual_button ;
|
|
|
|
Gtk::Button size_button ;
|
|
|
|
|
|
|
|
/** the name of this TimeAxis object */
|
|
|
|
std::string time_axis_name ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// Super class methods not handled by VisualTimeAxis
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Not handled by purely Visual TimeAxis
|
|
|
|
*
|
|
|
|
* @todo should VisualTimeAxis handle this?
|
|
|
|
*/
|
2006-09-28 13:23:52 -04:00
|
|
|
void show_timestretch (nframes_t start, nframes_t end);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Not handle by purely visual TimeAxis
|
|
|
|
* @see show_timestratch
|
|
|
|
*/
|
|
|
|
virtual void hide_timestretch() ;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
private:
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_visual_time_axis_h__ */
|
|
|
|
|