X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Futil.h;h=8e65bbb5415cc236e496e56a83b92dbd45503082;hb=cfdd68eb5fb0ef8423e860103ad4e5510994f1da;hp=d91a6b435d55843522d538657a544314f98bb7ca;hpb=1b1bc528ee5ca1fee1bd33f9fb6f79cd551e3b33;p=dcpomatic.git diff --git a/src/lib/util.h b/src/lib/util.h index d91a6b435..8e65bbb54 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -49,8 +49,8 @@ extern "C" { #undef check -/** The maximum number of audio channels that we can cope with */ -#define MAX_AUDIO_CHANNELS 8 +/** The maximum number of audio channels that we can have in a DCP */ +#define MAX_DCP_AUDIO_CHANNELS 12 #define DCPOMATIC_HELLO "Boys, you gotta learn not to talk to nuns that way" @@ -141,6 +141,28 @@ private: char* _old; }; +/** @class ScopedTemporary + * @brief A temporary file which is deleted when the ScopedTemporary object goes out of scope. + */ +class ScopedTemporary +{ +public: + ScopedTemporary (); + ~ScopedTemporary (); + + /** @return temporary filename */ + boost::filesystem::path file () const { + return _file; + } + + char const * c_str () const; + FILE* open (char const *); + void close (); + +private: + boost::filesystem::path _file; + FILE* _open; +}; #endif