2006-07-23 08:03:19 -04:00
/*
2019-08-02 17:26:43 -04:00
* Copyright ( C ) 2006 - 2014 David Robillard < d @ drobilla . net >
* Copyright ( C ) 2007 Doug McLain < doug @ nostar . net >
* Copyright ( C ) 2008 - 2017 Paul Davis < paul @ linuxaudiosystems . com >
* Copyright ( C ) 2009 - 2012 Carl Hetherington < carl @ carlh . net >
* Copyright ( C ) 2016 - 2017 Robin Gareus < robin @ gareus . org >
*
* 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 . ,
* 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 USA .
*/
2006-07-23 08:03:19 -04:00
# ifndef __ardour_midi_streamview_h__
# define __ardour_midi_streamview_h__
# include <list>
# include <cmath>
2009-02-25 13:26:51 -05:00
# include "ardour/location.h"
2006-07-23 08:03:19 -04:00
# include "enums.h"
2023-11-25 17:25:29 -05:00
# include "midi_view_background.h"
2006-07-23 08:03:19 -04:00
# include "streamview.h"
2007-08-04 00:18:34 -04:00
# include "time_axis_view_item.h"
# include "route_time_axis.h"
2006-07-23 08:03:19 -04:00
namespace Gdk {
class Color ;
}
namespace ARDOUR {
class Crossfade ;
2012-05-23 22:54:10 -04:00
class MidiModel ;
2006-07-23 08:03:19 -04:00
class MidiRegion ;
2012-05-23 22:54:10 -04:00
class Route ;
2006-07-23 08:03:19 -04:00
class Source ;
2012-05-23 22:54:10 -04:00
struct PeakData ;
2006-07-23 08:03:19 -04:00
}
2013-04-04 00:32:52 -04:00
namespace ArdourCanvas {
class LineSet ;
}
2006-07-23 08:03:19 -04:00
class PublicEditor ;
class Selectable ;
class MidiTimeAxisView ;
class MidiRegionView ;
class RegionSelection ;
class CrossfadeView ;
class Selection ;
2023-11-25 17:25:29 -05:00
class MidiStreamView : public StreamView , public MidiViewBackground
2006-07-23 08:03:19 -04:00
{
2017-07-01 15:11:14 -04:00
public :
2009-07-09 13:58:13 -04:00
MidiStreamView ( MidiTimeAxisView & ) ;
2006-07-23 08:03:19 -04:00
~ MidiStreamView ( ) ;
2009-05-12 13:03:42 -04:00
void get_inverted_selectables ( Selection & , std : : list < Selectable * > & results ) ;
2020-04-16 14:16:45 -04:00
void get_regions_with_selected_data ( RegionSelection & ) ;
2006-07-23 08:03:19 -04:00
2017-01-29 09:02:07 -05:00
void set_layer_display ( LayerDisplay ) ;
2017-07-01 15:11:14 -04:00
//bool can_change_layer_display() const { return false; } // revert this change for now. Although stacked view is weirdly implemented wrt the "scroomer", it is still necessary to be able to manage layered regions.
2010-04-21 16:42:22 -04:00
void redisplay_track ( ) ;
2009-10-14 12:10:01 -04:00
2023-11-25 17:25:29 -05:00
double contents_height ( ) const {
2017-07-01 15:11:14 -04:00
return ( child_height ( ) - TimeAxisViewItem : : NAME_HIGHLIGHT_SIZE - 2 ) ;
}
2009-10-14 12:10:01 -04:00
2024-01-16 14:16:46 -05:00
double y_position ( ) const ;
2023-02-16 18:33:28 -05:00
RegionView * create_region_view ( std : : shared_ptr < ARDOUR : : Region > , bool , bool ) ;
2009-06-08 15:28:51 -04:00
2020-10-19 14:37:54 -04:00
bool paste ( Temporal : : timepos_t const & pos , const Selection & selection , PasteContext & ctx ) ;
2014-12-16 14:37:40 -05:00
2011-04-16 09:31:27 -04:00
void suspend_updates ( ) ;
void resume_updates ( ) ;
2022-12-08 19:36:15 -05:00
ArdourCanvas : : Container * region_canvas ( ) const { return _region_group ; }
2023-02-05 13:36:24 -05:00
void parameter_changed ( std : : string const & ) ;
2024-01-04 21:07:52 -05:00
uint8_t get_preferred_midi_channel ( ) const ;
void record_layer_check ( std : : shared_ptr < ARDOUR : : Region > , samplepos_t ) ;
void set_note_highlight ( bool ) ;
2023-02-05 13:36:24 -05:00
2017-07-01 15:11:14 -04:00
protected :
2006-07-23 08:03:19 -04:00
void setup_rec_box ( ) ;
2010-10-08 10:54:16 -04:00
void update_rec_box ( ) ;
2023-11-25 17:25:29 -05:00
bool updates_suspended ( ) const { return _updates_suspended ; }
2008-09-22 22:40:29 -04:00
2022-12-08 19:36:15 -05:00
ArdourCanvas : : Container * _region_group ;
2017-07-01 15:11:14 -04:00
private :
2008-09-22 22:40:29 -04:00
RegionView * add_region_view_internal (
2023-02-16 18:33:28 -05:00
std : : shared_ptr < ARDOUR : : Region > ,
2017-07-01 15:11:14 -04:00
bool wait_for_waves ,
bool recording = false ) ;
2008-09-22 22:40:29 -04:00
void display_region ( MidiRegionView * region_view , bool load_model ) ;
2023-02-16 18:33:28 -05:00
void display_track ( std : : shared_ptr < ARDOUR : : Track > tr ) ;
2024-01-08 16:35:15 -05:00
void update_contents_height ( ) ;
2023-11-25 17:25:29 -05:00
void update_contents_metrics ( std : : shared_ptr < ARDOUR : : Region > r ) ;
2007-06-15 18:08:27 -04:00
void color_handler ( ) ;
2023-11-25 17:25:29 -05:00
void apply_note_range_to_children ( ) ;
2008-01-13 12:45:17 -05:00
2011-04-16 09:31:27 -04:00
/** true if updates to the note lines and regions are currently suspended */
2023-11-26 11:11:04 -05:00
bool _updates_suspended ;
2006-07-23 08:03:19 -04:00
} ;
# endif /* __ardour_midi_streamview_h__ */