unfinished work on selection/HiG details, restore range ops destroyed by autoscroll changes

git-svn-id: svn://localhost/trunk/ardour2@544 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis
2006-05-31 02:46:04 +00:00
parent 0354401e00
commit 415d3a5018
22 changed files with 587 additions and 280 deletions

View File

@@ -75,10 +75,11 @@ class AudioRegion : public Region
AudioRegion (SourceList &, const XMLNode&);
~AudioRegion();
bool region_list_equivalent (const AudioRegion&);
bool source_equivalent (const AudioRegion&);
bool equivalent (const AudioRegion&);
bool size_equivalent (const AudioRegion&);
bool region_list_equivalent (const AudioRegion&) const ;
bool source_equivalent (const AudioRegion&) const;
bool equivalent (const AudioRegion&) const;
bool size_equivalent (const AudioRegion&) const;
bool overlap_equivalent (const AudioRegion&) const;
bool speed_mismatch (float) const;

View File

@@ -42,12 +42,13 @@ CONFIG_VARIABLE(HeaderFormat, native_file_header_format, "native-file-header-fo
CONFIG_VARIABLE(bool, use_tranzport, "use-tranzport", false)
CONFIG_VARIABLE(uint32_t, osc_port, "osc-port", 3819)
CONFIG_VARIABLE(bool, use_osc, "use-osc", true)
CONFIG_VARIABLE(bool, use_overlap_equivalency, "use-overlap-equivalency", true)
CONFIG_VARIABLE(bool, meter_falloff_off, "meter-falloff-off", false)
CONFIG_VARIABLE(bool, meter_falloff_slowest, "meter-falloff-slowest", false)
CONFIG_VARIABLE(bool, meter_falloff_slower, "meter-falloff-slower", false)
CONFIG_VARIABLE(bool, meter_falloff_slow, "meter-falloff-slow", false)
CONFIG_VARIABLE(bool, meter_falloff_medium, "meter-falloff-medium", false)
CONFIG_VARIABLE(bool, meter_falloff_fast, "meter-falloff-fast", false)
CONFIG_VARIABLE(bool, meter_falloff_fast, "meter-falloff-fast", true)
CONFIG_VARIABLE(bool, meter_falloff_faster, "meter-falloff-faster", false)
CONFIG_VARIABLE(bool, meter_falloff_fastest, "meter-falloff-fastest", false)
CONFIG_VARIABLE(bool, meter_hold_off, "meter-hold-off", false)

View File

@@ -159,6 +159,9 @@ class Locations : public Stateful, public StateManager
Location *first_location_before (jack_nframes_t);
Location *first_location_after (jack_nframes_t);
jack_nframes_t first_mark_before (jack_nframes_t);
jack_nframes_t first_mark_after (jack_nframes_t);
sigc::signal<void,Location*> current_changed;
sigc::signal<void> changed;
sigc::signal<void,Location*> added;

View File

@@ -886,8 +886,14 @@ AudioPlaylist::get_equivalent_regions (const AudioRegion& other, vector<AudioReg
AudioRegion* ar = dynamic_cast<AudioRegion*> (*i);
if (ar && ar->equivalent (other)) {
results.push_back (ar);
if (ar) {
if (Config->get_use_overlap_equivalency()) {
if (ar->overlap_equivalent (other)) {
results.push_back (ar);
} else if (ar->equivalent (other)) {
results.push_back (ar);
}
}
}
}
}

View File

@@ -1139,15 +1139,15 @@ AudioRegion::master_source_names ()
}
bool
AudioRegion::region_list_equivalent (const AudioRegion& other)
AudioRegion::region_list_equivalent (const AudioRegion& other) const
{
return size_equivalent (other) && source_equivalent (other) && _name == other._name;
}
bool
AudioRegion::source_equivalent (const AudioRegion& other)
AudioRegion::source_equivalent (const AudioRegion& other) const
{
SourceList::iterator i;
SourceList::const_iterator i;
SourceList::const_iterator io;
for (i = sources.begin(), io = other.sources.begin(); i != sources.end() && io != other.sources.end(); ++i, ++io) {
@@ -1166,7 +1166,13 @@ AudioRegion::source_equivalent (const AudioRegion& other)
}
bool
AudioRegion::equivalent (const AudioRegion& other)
AudioRegion::overlap_equivalent (const AudioRegion& other) const
{
return coverage (other.first_frame(), other.last_frame()) != OverlapNone;
}
bool
AudioRegion::equivalent (const AudioRegion& other) const
{
return _start == other._start &&
_position == other._position &&
@@ -1174,7 +1180,7 @@ AudioRegion::equivalent (const AudioRegion& other)
}
bool
AudioRegion::size_equivalent (const AudioRegion& other)
AudioRegion::size_equivalent (const AudioRegion& other) const
{
return _start == other._start &&
_length == other._length;

View File

@@ -656,6 +656,80 @@ Locations::first_location_after (jack_nframes_t frame)
return 0;
}
jack_nframes_t
Locations::first_mark_before (jack_nframes_t frame)
{
LocationList locs;
{
LockMonitor lm (lock, __LINE__, __FILE__);
locs = locations;
}
LocationStartLaterComparison cmp;
locs.sort (cmp);
/* locs is now sorted latest..earliest */
for (LocationList::iterator i = locs.begin(); i != locs.end(); ++i) {
if (!(*i)->is_hidden()) {
if ((*i)->is_mark()) {
/* MARK: start == end */
if ((*i)->start() < frame) {
return (*i)->start();
}
} else {
/* RANGE: start != end, compare start and end */
if ((*i)->end() < frame) {
return (*i)->end();
}
if ((*i)->start () < frame) {
return (*i)->start();
}
}
}
}
return 0;
}
jack_nframes_t
Locations::first_mark_after (jack_nframes_t frame)
{
LocationList locs;
{
LockMonitor lm (lock, __LINE__, __FILE__);
locs = locations;
}
LocationStartEarlierComparison cmp;
locs.sort (cmp);
/* locs is now sorted earliest..latest */
for (LocationList::iterator i = locs.begin(); i != locs.end(); ++i) {
if (!(*i)->is_hidden()) {
if ((*i)->is_mark()) {
/* MARK, start == end so just compare start */
if ((*i)->start() > frame) {
return (*i)->start();
}
} else {
/* RANGE, start != end, compare start and end */
if ((*i)->start() > frame ) {
return (*i)->start ();
}
if ((*i)->end() > frame) {
return (*i)->end ();
}
}
}
}
return max_frames;
}
Location*
Locations::end_location () const
{

View File

@@ -175,10 +175,13 @@ tokenize_fullpath (string fullpath, string& path, string& name)
}
int
touch_file(string path)
touch_file (string path)
{
FILE* file = fopen(path.c_str(), "a");
fclose(file);
int fd = open (path.c_str(), O_RDONLY|O_CREAT);
if (fd >= 0) {
close (fd);
return 0;
}
return 1;
}

View File

@@ -60,7 +60,7 @@ if env['NLS']:
env.Alias('install', env.Install(os.path.join(install_prefix, 'lib/ardour2'), libpbd3))
env.Alias('tarball', env.Distribute (env['DISTTREE'],
[ 'SConscript', 'i18n.h' ] +
[ 'SConscript', 'i18n.h', 'gettext.h', 'pbd/abstract_ui.cc' ] +
pbd3_files +
glob.glob('po/*.po') +
glob.glob('pbd/*.h')))

View File

@@ -77,6 +77,7 @@ UndoCommand::clear ()
void
UndoCommand::undo ()
{
cerr << "Undo " << _name << endl;
for (list<UndoAction>::reverse_iterator i = undo_actions.rbegin(); i != undo_actions.rend(); ++i) {
(*i)();
}
@@ -85,6 +86,7 @@ UndoCommand::undo ()
void
UndoCommand::redo ()
{
cerr << "Redo " << _name << endl;
for (list<UndoAction>::iterator i = redo_actions.begin(); i != redo_actions.end(); ++i) {
(*i)();
}

View File

@@ -49,6 +49,6 @@ if env['NLS']:
env.Alias('install', env.Install(os.path.join(install_prefix, 'lib/ardour2'), libardour_cp))
env.Alias('tarball', env.Distribute (env['DISTTREE'],
[ 'SConscript', 'i18n.h', 'gettext.h' ] +
[ 'SConscript' ] +
cp_files +
glob.glob('po/*.po') + glob.glob('*.h')))

View File

@@ -50,6 +50,6 @@ if env['NLS']:
env.Alias('install', env.Install(os.path.join(install_prefix, 'lib/ardour2/surfaces'), libardour_genericmidi))
env.Alias('tarball', env.Distribute (env['DISTTREE'],
[ 'SConscript', 'i18n.h', 'gettext.h' ] +
[ 'SConscript' ] +
genericmidi_files +
glob.glob('po/*.po') + glob.glob('*.h')))

View File

@@ -50,6 +50,6 @@ if env['NLS']:
env.Alias('install', env.Install(os.path.join(install_prefix, 'lib/ardour2/surfaces'), libardour_tranzport))
env.Alias('tarball', env.Distribute (env['DISTTREE'],
[ 'SConscript', 'i18n.h', 'gettext.h' ] +
[ 'SConscript' ] +
tranzport_files +
glob.glob('po/*.po') + glob.glob('*.h')))