Ardour  8.12
export_filename.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2013 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2009 David Robillard <d@drobilla.net>
4  * Copyright (C) 2010-2013 Sakari Bergen <sakari.bergen@beatwaves.net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 #ifndef __ardour_export_filename_h__
22 #define __ardour_export_filename_h__
23 
24 #include <memory>
25 #include <string>
26 
27 #include <ardour/export_pointers.h>
28 
30 
31 namespace ARDOUR
32 {
33 
34 class Session;
35 
37  public:
38 
39  enum DateFormat {
41  D_ISO, // ISO 8601 full date
42  D_ISOShortY, // Like ISO 8601, but short year representation
43  D_BE, // big endian (no deliminator)
44  D_BEShortY // big endian short year representation
45  };
46 
47  enum TimeFormat {
50  T_Delim
51  };
52 
53  private:
54  friend class ExportElementFactory;
56 
57  public:
58  /* Serialization */
59 
60  XMLNode & get_state () const;
61  int set_state (const XMLNode &);
62 
63  /* data access */
64 
65  std::string get_path (ExportFormatSpecPtr format) const;
66  std::string get_folder () const { return folder; }
67 
68  TimeFormat get_time_format () const { return time_format; }
69  DateFormat get_date_format () const { return date_format; }
70  std::string get_time_format_str (TimeFormat format) const;
71  std::string get_date_format_str (DateFormat format) const;
72 
73  std::string get_label () const { return label; }
74  uint32_t get_revision () const { return revision; }
75 
76  /* data modification */
77 
78  void set_time_format (TimeFormat format);
79  void set_date_format (DateFormat format);
80  void set_label (std::string value);
81  void set_revision (uint32_t value) { revision = value; }
82  void set_channel (uint32_t value) { channel = value; }
83  bool set_folder (std::string path);
84 
85  void set_timespan (ExportTimespanPtr ts) { timespan = ts; }
86  void set_channel_config (ExportChannelConfigPtr cc) { channel_config = cc; }
87 
88  /* public members */
89 
100 
101  private:
102 
104 
105  std::string label;
106  uint32_t revision;
107  uint32_t channel;
108 
109  std::string folder;
110 
113 
114  std::string get_formatted_time (std::string const & format) const;
115  struct tm time_struct;
116 
119 
120  /* Serialization helpers */
121 
122  typedef std::pair<bool, std::string> FieldPair;
123 
124  static void add_field (XMLNode * node, std::string const & name, bool enabled, std::string const & value = "");
125  FieldPair get_field (XMLNode const & node, std::string const & name);
127 };
128 
129 
130 } // namespace ARDOUR
131 
132 #endif /* __ardour_export_filename_h__ */
std::string get_formatted_time(std::string const &format) const
bool set_folder(std::string path)
std::string get_date_format_str(DateFormat format) const
FieldPair analyse_folder() const
std::string get_label() const
std::string get_path(ExportFormatSpecPtr format) const
ExportFilename(Session &session)
void set_time_format(TimeFormat format)
FieldPair get_field(XMLNode const &node, std::string const &name)
int set_state(const XMLNode &)
void set_channel(uint32_t value)
ExportChannelConfigPtr channel_config
std::string get_time_format_str(TimeFormat format) const
static void add_field(XMLNode *node, std::string const &name, bool enabled, std::string const &value="")
std::string get_folder() const
DateFormat get_date_format() const
void set_timespan(ExportTimespanPtr ts)
void set_label(std::string value)
TimeFormat get_time_format() const
ExportTimespanPtr timespan
XMLNode & get_state() const
void set_channel_config(ExportChannelConfigPtr cc)
void set_date_format(DateFormat format)
void set_revision(uint32_t value)
std::pair< bool, std::string > FieldPair
uint32_t get_revision() const
Definition: xml++.h:114
GtkImageIconNameData name
Definition: gtkimage.h:6
#define LIBARDOUR_API
void session(lua_State *L)
std::shared_ptr< ExportChannelConfiguration > ExportChannelConfigPtr
const char * revision
std::shared_ptr< ExportFormatSpecification > ExportFormatSpecPtr