mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
add timestamp to location and date sorting from timestamps to export_timespan_selector
This commit is contained in:
parent
3e7e89db8f
commit
59b6b46a13
4 changed files with 26 additions and 3 deletions
|
|
@ -405,6 +405,7 @@ ExportTimespanSelectorSingle::ExportTimespanSelectorSingle (ARDOUR::Session * se
|
||||||
range_view.append_column (*label_col);
|
range_view.append_column (*label_col);
|
||||||
|
|
||||||
range_view.append_column (_("Length"), range_cols.length);
|
range_view.append_column (_("Length"), range_cols.length);
|
||||||
|
range_view.append_column (_("Creation Date"), range_cols.date);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -443,7 +444,10 @@ ExportTimespanSelectorSingle::fill_range_list ()
|
||||||
row[range_cols.realtime] = realtime;
|
row[range_cols.realtime] = realtime;
|
||||||
row[range_cols.name] = (*it)->name();
|
row[range_cols.name] = (*it)->name();
|
||||||
row[range_cols.label] = construct_label (*it);
|
row[range_cols.label] = construct_label (*it);
|
||||||
row[range_cols.length] = construct_length (*it);
|
|
||||||
|
Glib::DateTime gdt(Glib::DateTime::create_now_local ((*it)->timestamp()));
|
||||||
|
row[range_cols.timestamp] = (*it)->timestamp();
|
||||||
|
row[range_cols.date] = gdt.format ("%F %H:%M");;
|
||||||
|
|
||||||
add_range_to_selection (*it, false);
|
add_range_to_selection (*it, false);
|
||||||
|
|
||||||
|
|
@ -496,6 +500,11 @@ ExportTimespanSelectorMultiple::ExportTimespanSelectorMultiple (ARDOUR::Session
|
||||||
range_view.append_column (*label_col);
|
range_view.append_column (*label_col);
|
||||||
|
|
||||||
range_view.append_column (_("Length"), range_cols.length);
|
range_view.append_column (_("Length"), range_cols.length);
|
||||||
|
range_view.append_column (_("Creation Date"), range_cols.date);
|
||||||
|
|
||||||
|
range_list->set_sort_column(5, Gtk::SORT_DESCENDING);
|
||||||
|
Gtk::TreeViewColumn* date_col = range_view.get_column(5); // date column
|
||||||
|
date_col->set_sort_column(7); // set sort as the timestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -526,6 +535,10 @@ ExportTimespanSelectorMultiple::fill_range_list ()
|
||||||
row[range_cols.name] = (*it)->name();
|
row[range_cols.name] = (*it)->name();
|
||||||
row[range_cols.label] = construct_label (*it);
|
row[range_cols.label] = construct_label (*it);
|
||||||
row[range_cols.length] = construct_length (*it);
|
row[range_cols.length] = construct_length (*it);
|
||||||
|
|
||||||
|
Glib::DateTime gdt(Glib::DateTime::create_now_local ((*it)->timestamp()));
|
||||||
|
row[range_cols.timestamp] = (*it)->timestamp();
|
||||||
|
row[range_cols.date] = gdt.format ("%F %H:%M");;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_selection_from_state ();
|
set_selection_from_state ();
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
#include "audio_clock.h"
|
#include "audio_clock.h"
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
#ifdef interface
|
#ifdef interface
|
||||||
#undef interface
|
#undef interface
|
||||||
|
|
@ -136,8 +137,10 @@ protected:
|
||||||
Gtk::TreeModelColumn<bool> realtime;
|
Gtk::TreeModelColumn<bool> realtime;
|
||||||
Gtk::TreeModelColumn<std::string> name;
|
Gtk::TreeModelColumn<std::string> name;
|
||||||
Gtk::TreeModelColumn<std::string> length;
|
Gtk::TreeModelColumn<std::string> length;
|
||||||
|
Gtk::TreeModelColumn<std::string> date;
|
||||||
|
Gtk::TreeModelColumn<time_t> timestamp;
|
||||||
|
|
||||||
RangeCols () { add (location); add(label); add(selected); add(realtime); add(name); add(length); }
|
RangeCols () { add (location); add(label); add(selected); add(realtime); add(name); add(length); add(date); add(timestamp);}
|
||||||
};
|
};
|
||||||
RangeCols range_cols;
|
RangeCols range_cols;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
|
@ -69,6 +70,8 @@ public:
|
||||||
void lock ();
|
void lock ();
|
||||||
void unlock ();
|
void unlock ();
|
||||||
|
|
||||||
|
time_t timestamp() { return _timestamp; };
|
||||||
|
|
||||||
samplepos_t start() const { return _start; }
|
samplepos_t start() const { return _start; }
|
||||||
samplepos_t end() const { return _end; }
|
samplepos_t end() const { return _end; }
|
||||||
samplecnt_t length() const { return _end - _start; }
|
samplecnt_t length() const { return _end - _start; }
|
||||||
|
|
@ -160,6 +163,7 @@ private:
|
||||||
bool _locked;
|
bool _locked;
|
||||||
PositionLockStyle _position_lock_style;
|
PositionLockStyle _position_lock_style;
|
||||||
boost::shared_ptr<SceneChange> _scene_change;
|
boost::shared_ptr<SceneChange> _scene_change;
|
||||||
|
time_t _timestamp;
|
||||||
|
|
||||||
void set_mark (bool yn);
|
void set_mark (bool yn);
|
||||||
bool set_flag_internal (bool yn, Flags flag);
|
bool set_flag_internal (bool yn, Flags flag);
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@ Location::Location (Session& s)
|
||||||
, _flags (Flags (0))
|
, _flags (Flags (0))
|
||||||
, _locked (false)
|
, _locked (false)
|
||||||
, _position_lock_style (AudioTime)
|
, _position_lock_style (AudioTime)
|
||||||
|
, _timestamp(time(0))
|
||||||
{
|
{
|
||||||
assert (_start >= 0);
|
assert (_start >= 0);
|
||||||
assert (_end >= 0);
|
assert (_end >= 0);
|
||||||
|
|
@ -79,7 +80,7 @@ Location::Location (Session& s, samplepos_t sample_start, samplepos_t sample_end
|
||||||
, _flags (bits)
|
, _flags (bits)
|
||||||
, _locked (false)
|
, _locked (false)
|
||||||
, _position_lock_style (s.config.get_glue_new_markers_to_bars_and_beats() ? MusicTime : AudioTime)
|
, _position_lock_style (s.config.get_glue_new_markers_to_bars_and_beats() ? MusicTime : AudioTime)
|
||||||
|
, _timestamp(time(0))
|
||||||
{
|
{
|
||||||
recompute_beat_from_samples (sub_num);
|
recompute_beat_from_samples (sub_num);
|
||||||
|
|
||||||
|
|
@ -599,6 +600,7 @@ Location::get_state ()
|
||||||
node->set_property ("flags", _flags);
|
node->set_property ("flags", _flags);
|
||||||
node->set_property ("locked", _locked);
|
node->set_property ("locked", _locked);
|
||||||
node->set_property ("position-lock-style", _position_lock_style);
|
node->set_property ("position-lock-style", _position_lock_style);
|
||||||
|
node->set_property ("timestamp", _timestamp);
|
||||||
|
|
||||||
if (_scene_change) {
|
if (_scene_change) {
|
||||||
node->add_child_nocopy (_scene_change->get_state());
|
node->add_child_nocopy (_scene_change->get_state());
|
||||||
|
|
@ -683,6 +685,7 @@ Location::set_state (const XMLNode& node, int version)
|
||||||
}
|
}
|
||||||
|
|
||||||
node.get_property ("position-lock-style", _position_lock_style);
|
node.get_property ("position-lock-style", _position_lock_style);
|
||||||
|
node.get_property ("timestamp", _timestamp);
|
||||||
|
|
||||||
XMLNode* scene_child = find_named_node (node, SceneChange::xml_node_name);
|
XMLNode* scene_child = find_named_node (node, SceneChange::xml_node_name);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue