2 Copyright (C) 2008 Paul Davis
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __ardour_export_filename_h__
22 #define __ardour_export_filename_h__
24 #include <boost/shared_ptr.hpp>
28 #include <ardour/export_pointers.h>
30 #include "pbd/statefuldestructible.h"
37 class LIBARDOUR_API ExportFilename {
42 D_ISO, // ISO 8601 full date
43 D_ISOShortY, // Like ISO 8601, but short year representation
44 D_BE, // big endian (no deliminator)
45 D_BEShortY // big endian short year representation
55 friend class ExportElementFactory;
56 ExportFilename (Session & session);
61 XMLNode & get_state ();
62 int set_state (const XMLNode &);
66 std::string get_path (ExportFormatSpecPtr format) const;
67 std::string get_folder () const { return folder; }
69 TimeFormat get_time_format () const { return time_format; }
70 DateFormat get_date_format () const { return date_format; }
71 std::string get_time_format_str (TimeFormat format) const;
72 std::string get_date_format_str (DateFormat format) const;
74 std::string get_label () const { return label; }
75 uint32_t get_revision () const { return revision; }
77 /* data modification */
79 void set_time_format (TimeFormat format);
80 void set_date_format (DateFormat format);
81 void set_label (std::string value);
82 void set_revision (uint32_t value) { revision = value; }
83 void set_channel (uint32_t value) { channel = value; }
84 bool set_folder (std::string path);
86 void set_timespan (ExportTimespanPtr ts) { timespan = ts; }
87 void set_channel_config (ExportChannelConfigPtr cc) { channel_config = cc; }
93 bool use_session_snapshot_name;
94 bool include_revision;
95 bool include_channel_config;
96 bool include_format_name;
98 bool include_timespan;
112 DateFormat date_format;
113 TimeFormat time_format;
115 std::string get_formatted_time (std::string const & format) const;
116 struct tm time_struct;
118 ExportTimespanPtr timespan;
119 ExportChannelConfigPtr channel_config;
121 /* Serialization helpers */
123 typedef std::pair<bool, std::string> FieldPair;
125 void add_field (XMLNode * node, std::string const & name, bool enabled, std::string const & value = "");
126 FieldPair get_field (XMLNode const & node, std::string const & name);
127 FieldPair analyse_folder ();
131 } // namespace ARDOUR
133 #endif /* __ardour_export_filename_h__ */