2005-09-25 14:42:24 -04:00
|
|
|
/*
|
|
|
|
Copyright (C) 2001 Paul Davis
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
$Id$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ardour_streamview_h__
|
|
|
|
#define __ardour_streamview_h__
|
|
|
|
|
|
|
|
#include <list>
|
|
|
|
#include <map>
|
|
|
|
#include <cmath>
|
|
|
|
|
|
|
|
#include <ardour/location.h>
|
|
|
|
#include "enums.h"
|
2005-11-12 22:53:51 -05:00
|
|
|
#include "simplerect.h"
|
2005-11-23 12:21:12 -05:00
|
|
|
#include "canvas.h"
|
2006-02-14 12:19:58 -05:00
|
|
|
#include "color.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-28 23:41:15 -05:00
|
|
|
namespace Gdk {
|
|
|
|
class Color;
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
namespace ARDOUR {
|
|
|
|
class Route;
|
|
|
|
class DiskStream;
|
|
|
|
class Crossfade;
|
|
|
|
class PeakData;
|
|
|
|
class AudioRegion;
|
|
|
|
class Source;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct RecBoxInfo {
|
2005-11-23 12:21:12 -05:00
|
|
|
ArdourCanvas::SimpleRect* rectangle;
|
2005-09-25 14:42:24 -04:00
|
|
|
jack_nframes_t start;
|
|
|
|
jack_nframes_t length;
|
|
|
|
};
|
|
|
|
|
|
|
|
class PublicEditor;
|
|
|
|
class Selectable;
|
|
|
|
class AudioTimeAxisView;
|
|
|
|
class AudioRegionView;
|
|
|
|
class AudioRegionSelection;
|
|
|
|
class CrossfadeView;
|
|
|
|
class Selection;
|
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
class StreamView : public sigc::trackable
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
StreamView (AudioTimeAxisView&);
|
|
|
|
~StreamView ();
|
|
|
|
|
|
|
|
void set_waveform_shape (WaveformShape);
|
|
|
|
|
|
|
|
AudioTimeAxisView& trackview() { return _trackview; }
|
|
|
|
|
|
|
|
void set_zoom_all();
|
|
|
|
|
|
|
|
int set_height (gdouble);
|
|
|
|
int set_position (gdouble x, gdouble y);
|
|
|
|
|
|
|
|
int set_samples_per_unit (gdouble spp);
|
|
|
|
gdouble get_samples_per_unit () { return _samples_per_unit; }
|
|
|
|
|
|
|
|
int set_amplitude_above_axis (gdouble app);
|
|
|
|
gdouble get_amplitude_above_axis () { return _amplitude_above_axis; }
|
|
|
|
|
|
|
|
void set_show_waveforms (bool yn);
|
|
|
|
void set_show_waveforms_recording (bool yn) { use_rec_regions = yn; }
|
|
|
|
|
2005-11-23 12:21:12 -05:00
|
|
|
ArdourCanvas::Item* canvas_item() { return canvas_group; }
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
sigc::signal<void,AudioRegionView*> AudioRegionViewAdded;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
enum ColorTarget {
|
|
|
|
RegionColor,
|
|
|
|
StreamBaseColor
|
|
|
|
};
|
|
|
|
|
2005-10-06 00:59:20 -04:00
|
|
|
void apply_color (Gdk::Color&, ColorTarget t);
|
2005-09-25 14:42:24 -04:00
|
|
|
void set_selected_regionviews (AudioRegionSelection&);
|
|
|
|
void get_selectables (jack_nframes_t start, jack_nframes_t end, list<Selectable* >&);
|
|
|
|
void get_inverted_selectables (Selection&, list<Selectable* >& results);
|
2005-10-06 00:59:20 -04:00
|
|
|
Gdk::Color get_region_color () const { return region_color; }
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
void foreach_regionview (sigc::slot<void,AudioRegionView*> slot);
|
2005-09-25 14:42:24 -04:00
|
|
|
void foreach_crossfadeview (void (CrossfadeView::*pmf)(void));
|
|
|
|
|
|
|
|
void attach ();
|
|
|
|
|
|
|
|
void region_layered (AudioRegionView*);
|
|
|
|
|
|
|
|
AudioRegionView* find_view (const ARDOUR::AudioRegion&);
|
|
|
|
|
|
|
|
void show_all_xfades ();
|
|
|
|
void hide_all_xfades ();
|
|
|
|
void hide_xfades_involving (AudioRegionView&);
|
|
|
|
void reveal_xfades_involving (AudioRegionView&);
|
|
|
|
|
|
|
|
private:
|
|
|
|
AudioTimeAxisView& _trackview;
|
|
|
|
|
2005-11-23 12:21:12 -05:00
|
|
|
ArdourCanvas::Group* canvas_group;
|
|
|
|
ArdourCanvas::SimpleRect* canvas_rect; /* frame around the whole thing */
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
typedef list<AudioRegionView* > AudioRegionViewList;
|
|
|
|
AudioRegionViewList region_views;
|
|
|
|
|
|
|
|
typedef list<CrossfadeView*> CrossfadeViewList;
|
|
|
|
CrossfadeViewList crossfade_views;
|
|
|
|
|
|
|
|
double _samples_per_unit;
|
|
|
|
double _amplitude_above_axis;
|
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
sigc::connection screen_update_connection;
|
2005-09-25 14:42:24 -04:00
|
|
|
vector<RecBoxInfo> rec_rects;
|
|
|
|
list<ARDOUR::AudioRegion* > rec_regions;
|
|
|
|
bool rec_updating;
|
|
|
|
bool rec_active;
|
|
|
|
bool use_rec_regions;
|
2005-09-25 16:33:00 -04:00
|
|
|
list<sigc::connection> peak_ready_connections;
|
2005-09-25 14:42:24 -04:00
|
|
|
jack_nframes_t last_rec_peak_frame;
|
|
|
|
map<ARDOUR::Source*, bool> rec_peak_ready_map;
|
|
|
|
|
|
|
|
void update_rec_box ();
|
|
|
|
void transport_changed();
|
|
|
|
void rec_enable_changed(void* src = 0);
|
|
|
|
void sess_rec_enable_changed();
|
|
|
|
void setup_rec_box ();
|
|
|
|
void rec_peak_range_ready (jack_nframes_t start, jack_nframes_t cnt, ARDOUR::Source* src);
|
|
|
|
void update_rec_regions ();
|
|
|
|
|
|
|
|
void add_region_view (ARDOUR::Region*);
|
|
|
|
void add_region_view_internal (ARDOUR::Region*, bool wait_for_waves);
|
|
|
|
void remove_region_view (ARDOUR::Region* );
|
|
|
|
void remove_rec_region (ARDOUR::Region*);
|
|
|
|
void remove_audio_region_view (ARDOUR::AudioRegion* );
|
|
|
|
void remove_audio_rec_region (ARDOUR::AudioRegion*);
|
|
|
|
|
|
|
|
void display_diskstream (ARDOUR::DiskStream* );
|
|
|
|
void undisplay_diskstream ();
|
|
|
|
void redisplay_diskstream ();
|
|
|
|
void diskstream_changed (void* );
|
|
|
|
void playlist_state_changed (ARDOUR::Change);
|
|
|
|
void playlist_changed (ARDOUR::DiskStream* );
|
|
|
|
void playlist_modified ();
|
|
|
|
|
|
|
|
bool crossfades_visible;
|
|
|
|
void add_crossfade (ARDOUR::Crossfade*);
|
|
|
|
void remove_crossfade (ARDOUR::Crossfade*);
|
|
|
|
|
|
|
|
/* XXX why are these different? */
|
|
|
|
|
2005-10-06 00:59:20 -04:00
|
|
|
Gdk::Color region_color;
|
2005-09-25 14:42:24 -04:00
|
|
|
uint32_t stream_base_color;
|
|
|
|
|
2006-02-14 12:19:58 -05:00
|
|
|
void color_handler (ColorID, uint32_t);
|
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
vector<sigc::connection> playlist_connections;
|
|
|
|
sigc::connection playlist_change_connection;
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_streamview_h__ */
|