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 AUDIOGRAPHER_BROADCAST_INFO_H
22 #define AUDIOGRAPHER_BROADCAST_INFO_H
31 #include "audiographer/visibility.h"
33 namespace AudioGrapher
38 class LIBAUDIOGRAPHER_API BroadcastInfo
42 /// Construct empty broadcast info
44 virtual ~BroadcastInfo ();
46 /// Returns last error sring from libsndfile
47 std::string get_error () const { return error; }
51 bool load_from_file (std::string const & filename);
52 bool load_from_file (SNDFILE* sf);
54 std::string get_description () const;
55 int64_t get_time_reference () const;
56 struct tm get_origination_time () const;
57 std::string get_originator () const;
58 std::string get_originator_ref () const;
62 bool write_to_file (std::string const & filename);
63 bool write_to_file (SNDFILE* sf);
64 bool write_to_file (SndfileHandle* sf);
66 void set_description (std::string const & desc);
67 void set_time_reference (int64_t when);
68 void set_origination_time (struct tm * now = 0); // if 0, use time generated at construction
69 virtual void set_originator (std::string const & str = "");
70 void set_originator_ref (std::string const & str = "");
74 /// Returns true if a info has been succesfully loaded or anything has been manually set
75 bool has_info () const { return _has_info; }
79 SF_BROADCAST_INFO * info;
88 } // namespace AudioGrapher
90 #endif /* AUDIOGRAPHER_BROADCAST_INFO_H */