Audacity  3.0.3
Types.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  Types.h
6 
7  Leland Lucius
8 
9  Copyright (c) 2014, Audacity Team
10  All rights reserved.
11 
12  Redistribution and use in source and binary forms, with or without
13  modification, are permitted provided that the following conditions
14  are met:
15 
16  1. Redistributions of source code must retain the above copyright
17  notice, this list of conditions and the following disclaimer.
18 
19  2. Redistributions in binary form must reproduce the above copyright
20  notice, this list of conditions and the following disclaimer in the
21  documentation and/or other materials provided with the distribution.
22 
23  3. Neither the name of the copyright holder nor the names of its
24  contributors may be used to endorse or promote products derived from
25  this software without specific prior written permission.
26 
27  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
30  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
31  COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
32  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
33  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
34  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
35  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38  POSSIBILITY OF SUCH DAMAGE.
39 
40 **********************************************************************/
41 
42 #ifndef __AUDACITY_TYPES_H__
43 #define __AUDACITY_TYPES_H__
44 
45 #include <algorithm>
46 #include <functional>
47 #include <type_traits>
48 #include <vector>
49 #include <wx/debug.h> // for wxASSERT
50 #include <wx/string.h> // type used in inline function and member variable
51 
52 // ----------------------------------------------------------------------------
53 // TODO: I'd imagine this header may be replaced by other public headers. But,
54 // to try and minimize more changes to the base code, we can use this
55 // until proper public headers are created for the stuff in here.
56 // ----------------------------------------------------------------------------
57 
58 // An explicitly nonlocalized string, not meant for the user to see.
59 // String manipulations are discouraged, other than splitting and joining on
60 // separator characters.
61 // Wherever GET is used to fetch the underlying wxString, there should be a
62 // comment explaining the need for it.
64 {
65 public:
66 
67  Identifier() = default;
68 
69  // Allow implicit conversion to this class, but not from
70  Identifier(const wxString &str) : value{ str } {}
71 
72  // Allow implicit conversion to this class, but not from
73  Identifier(const wxChar *str) : value{ str } {}
74 
75  // Allow implicit conversion to this class, but not from
76  Identifier(const char *str) : value{ str } {}
77 
78  // Copy construction and assignment
79  Identifier( const Identifier & ) = default;
80  Identifier &operator = ( const Identifier& ) = default;
81 
82  // Move construction and assignment
83  Identifier( wxString && str )
84  { value.swap( str ); }
86  { swap( id ); }
88  {
89  if ( this != &id )
90  value.clear(), swap( id );
91  return *this;
92  }
93 
94  // Implements moves
95  void swap( Identifier &id ) { value.swap( id.value ); }
96 
97  // Convenience for building concatenated identifiers.
98  // The list must have at least two members
99  // (so you don't easily circumvent the restrictions on interconversions
100  // intended in TaggedIdentifier below)
101  explicit
102  Identifier(std::initializer_list<Identifier> components, wxChar separator);
103 
104  bool empty() const { return value.empty(); }
105  size_t size() const { return value.size(); }
106  size_t length() const { return value.length(); }
107 
108  // Explicit conversion to wxString, meant to be ugly-looking and
109  // demanding of a comment why it's correct
110  const wxString &GET() const { return value; }
111 
112  std::vector< Identifier > split( wxChar separator ) const;
113 
114 private:
115  wxString value;
116 };
117 
118 // Comparisons of Identifiers are case-sensitive
119 inline bool operator == ( const Identifier &x, const Identifier &y )
120 { return x.GET() == y.GET(); }
121 
122 inline bool operator != ( const Identifier &x, const Identifier &y )
123 { return !(x == y); }
124 
125 inline bool operator < ( const Identifier &x, const Identifier &y )
126 { return x.GET() < y.GET(); }
127 
128 inline bool operator > ( const Identifier &x, const Identifier &y )
129 { return y < x; }
130 
131 inline bool operator <= ( const Identifier &x, const Identifier &y )
132 { return !(y < x); }
133 
134 inline bool operator >= ( const Identifier &x, const Identifier &y )
135 { return !(x < y); }
136 
137 namespace std
138 {
139  template<> struct hash< Identifier > {
140  size_t operator () ( const Identifier &id ) const // noexcept
141  { return hash<wxString>{}( id.GET() ); }
142  };
143 }
144 
145 // This lets you pass Identifier into wxFileConfig::Read
146 inline bool wxFromString(const wxString& str, Identifier *id)
147  { if (id) { *id = str; return true; } else return false; }
148 
149 // This lets you pass Identifier into wxFileConfig::Write
150 inline wxString wxToString( const Identifier& str ) { return str.GET(); }
151 
152 // Template parameter allows generation of different TaggedIdentifier classes
153 // that don't interconvert implicitly
154 // The second template parameter determines whether comparisons are case
155 // sensitive; default is case sensitive
156 template<typename Tag, bool CaseSensitive = true >
158 {
159 public:
160 
161  using TagType = Tag;
162 
164  TaggedIdentifier() = default;
165 
166  // Allowed for the same Tag class and case sensitivity
167  TaggedIdentifier( const TaggedIdentifier& ) = default;
171 
172  // Prohibited for other Tag classes or case sensitivity
173  template< typename Tag2, bool b >
175  template< typename Tag2, bool b >
177  template< typename Tag2, bool b >
179  template< typename Tag2, bool b >
181 
182  // Allow implicit conversion to this class from un-tagged Identifier,
183  // but not from; resolution will use other overloads above if argument
184  // has a tag
185  TaggedIdentifier(const Identifier &str) : Identifier{ str } {}
186 
187  // Conversion to another kind of TaggedIdentifier
188  template<typename String, typename = typename String::TagType>
189  String CONVERT() const
190  { return String{ this->GET() }; }
191 };
192 
193 // Comparison of a TaggedIdentifier with an Identifier is allowed, resolving
194 // to one of the operators on Identifiers defined above, but always case
195 // sensitive.
196 
197 // Comparison operators for two TaggedIdentifiers, below, require the same tags
198 // and case sensitivity.
199 template< typename Tag1, typename Tag2, bool b1, bool b2 >
200 inline bool operator == (
202 {
203  static_assert( std::is_same< Tag1, Tag2 >::value && b1 == b2,
204  "TaggedIdentifiers with different tags or sensitivity are not comparable" );
205  // This test should be eliminated at compile time:
206  if ( b1 )
207  return x.GET(). Cmp ( y.GET() ) == 0;
208  else
209  return x.GET(). CmpNoCase ( y.GET() ) == 0;
210 }
211 
212 template< typename Tag1, typename Tag2, bool b1, bool b2 >
213 inline bool operator != (
215 { return !(x == y); }
216 
217 template< typename Tag1, typename Tag2, bool b1, bool b2 >
218 inline bool operator < (
220 {
221  static_assert( std::is_same< Tag1, Tag2 >::value && b1 == b2,
222  "TaggedIdentifiers with different tags or sensitivity are not comparable" );
223  // This test should be eliminated at compile time:
224  if ( b1 )
225  return x.GET(). Cmp ( y.GET() ) < 0;
226  else
227  return x.GET(). CmpNoCase ( y.GET() ) < 0;
228 }
229 
230 template< typename Tag1, typename Tag2, bool b1, bool b2 >
231 inline bool operator > (
233 { return y < x; }
234 
235 template< typename Tag1, typename Tag2, bool b1, bool b2 >
236 inline bool operator <= (
238 { return !(y < x); }
239 
240 template< typename Tag1, typename Tag2, bool b1, bool b2 >
241 inline bool operator >= (
243 { return !(x < y); }
244 
245 namespace std
246 {
247  template<typename Tag, bool b > struct hash< TaggedIdentifier<Tag, b> >
248  : hash< Identifier > {};
249 }
250 
251 /**************************************************************************/
257 using PluginPath = wxString;
258 using PluginPaths = std::vector< PluginPath >;
259 
260 // A key to be passed to wxConfigBase
261 using RegistryPath = wxString;
262 using RegistryPaths = std::vector< RegistryPath >;
263 
264 class wxArrayStringEx;
265 
266 // File extensions, not including any leading dot
267 using FileExtension = wxString;
269 
270 using FilePath = wxString;
272 
273 // Identifies a menu command or macro.
274 // Case-insensitive comparison
275 struct CommandIdTag;
277 using CommandIDs = std::vector<CommandID>;
278 
279 
280 // Holds a msgid for the translation catalog and may hold a closure that
281 // captures formatting arguments
282 //
283 // Different string-valued accessors for the msgid itself, and for the
284 // user-visible translation with substitution of captured format arguments.
285 // Also an accessor for format substitution into the English msgid, for debug-
286 // only outputs.
287 // The msgid should be used only in unusual cases and the translation more often
288 //
289 // Implicit conversions to and from wxString are intentionally disabled
290 class AUDACITY_DLL_API TranslatableString {
291  enum class Request;
292  template< size_t N > struct PluralTemp;
293 
294 public:
295  // A special string value that will have no screen reader pronunciation
297 
298  // A multi-purpose function, depending on the enum argument; the string
299  // argument is unused in some cases
300  // If there is no function, defaults are empty context string, no plurals,
301  // and no substitutions
302  using Formatter = std::function< wxString(const wxString &, Request) >;
303 
305 
306  // Supply {} for the second argument to cause lookup of the msgid with
307  // empty context string (default context) rather than the null context
308  explicit TranslatableString( wxString str, Formatter formatter )
309  : mFormatter{ std::move(formatter) }
310  {
311  mMsgid.swap( str );
312  }
313 
314  // copy and move
318  : mFormatter( std::move( str.mFormatter ) )
319  {
320  mMsgid.swap( str.mMsgid );
321  }
323  {
324  mFormatter = std::move( str.mFormatter );
325  mMsgid.swap( str.mMsgid );
326  return *this;
327  }
328 
329  bool empty() const { return mMsgid.empty(); }
330 
331  // MSGID is the English lookup key in the message catalog, not necessarily
332  // for user's eyes if the locale is some other.
333  // The MSGID might not be all the information TranslatableString holds.
334  // This is a deliberately ugly-looking function name. Use with caution.
335  Identifier MSGID() const { return Identifier{ mMsgid }; }
336 
337  wxString Translation() const { return DoFormat( false ); }
338 
339  // Format as an English string for debugging logs and developers' eyes, not
340  // for end users
341  wxString Debug() const { return DoFormat( true ); }
342 
343  // Warning: comparison of msgids only, which is not all of the information!
344  // This operator makes it easier to define a std::unordered_map on
345  // TranslatableStrings
346  friend bool operator == (
347  const TranslatableString &x, const TranslatableString &y)
348  { return x.mMsgid == y.mMsgid; }
349 
350  friend bool operator != (
351  const TranslatableString &x, const TranslatableString &y)
352  { return !(x == y); }
353 
354  // Returns true if context is NullContextFormatter
355  bool IsVerbatim() const;
356 
357  // Capture variadic format arguments (by copy) when there is no plural.
358  // The substitution is computed later in a call to Translate() after msgid is
359  // looked up in the translation catalog.
360  // Any format arguments that are also of type TranslatableString will be
361  // translated too at substitution time, for non-debug formatting
362  template< typename... Args >
363  TranslatableString &Format( Args &&...args ) &
364  {
365  auto prevFormatter = mFormatter;
366  this->mFormatter = [prevFormatter, args...]
367  (const wxString &str, Request request) -> wxString {
368  switch ( request ) {
369  case Request::Context:
370  return TranslatableString::DoGetContext( prevFormatter );
371  case Request::Format:
372  case Request::DebugFormat:
373  default: {
374  bool debug = request == Request::DebugFormat;
375  return wxString::Format(
377  prevFormatter,
378  str, TranslatableString::DoGetContext( prevFormatter ),
379  debug ),
380  TranslatableString::TranslateArgument( args, debug )...
381  );
382  }
383  }
384  };
385  return *this;
386  }
387  template< typename... Args >
388  TranslatableString &&Format( Args &&...args ) &&
389  {
390  return std::move( Format( std::forward<Args>(args)... ) );
391  }
392 
393  // Choose a non-default and non-null disambiguating context for lookups
394  // (but this is not fully implemented)
395  // This is meant to be the first of chain-call modifications of the
396  // TranslatableString object; it will destroy any previously captured
397  // information
398  TranslatableString &Context( const wxString &context ) &
399  {
400  this->mFormatter = [context]
401  (const wxString &str, Request request) -> wxString {
402  switch ( request ) {
403  case Request::Context:
404  return context;
405  case Request::DebugFormat:
406  return DoSubstitute( {}, str, context, true );
407  case Request::Format:
408  default:
409  return DoSubstitute( {}, str, context, false );
410  }
411  };
412  return *this;
413  }
414  TranslatableString &&Context( const wxString &context ) &&
415  {
416  return std::move( Context( context ) );
417  }
418 
419  // Append another translatable string; lookup of msgids for
420  // this and for the argument are both delayed until Translate() is invoked
421  // on this, and then the formatter concatenates the translations
422  TranslatableString &Join(
423  TranslatableString arg, const wxString &separator = {} ) &;
425  TranslatableString arg, const wxString &separator = {} ) &&
426  { return std::move( Join( std::move(arg), separator ) ); }
427 
429  {
430  Join( std::move( arg ) );
431  return *this;
432  }
433 
434  // Implements the XP macro, which specifies a second msgid, a list
435  // of format arguments, and which of those format arguments selects among
436  // messages; the translated strings to select among, depending on language,
437  // might actually be more or fewer than two. See Internat.h.
438  template< size_t N >
439  PluralTemp< N > Plural( const wxString &pluralStr ) &&
440  {
441  return PluralTemp< N >{ *this, pluralStr };
442  }
443 
444  // Translated strings may still contain menu hot-key codes (indicated by &)
445  // that wxWidgets interprets, and also trailing ellipses, that should be
446  // removed for other uses.
447  enum StripOptions : unsigned {
448  // Values to be combined with bitwise OR
449  MenuCodes = 0x1,
450  Ellipses = 0x2,
451  };
452  TranslatableString &Strip( unsigned options = MenuCodes ) &;
453  TranslatableString &&Strip( unsigned options = MenuCodes ) &&
454  { return std::move( Strip( options ) ); }
455 
456  // non-mutating, constructs another TranslatableString object
457  TranslatableString Stripped( unsigned options = MenuCodes ) const
458  { return TranslatableString{ *this }.Strip( options ); }
459 
460  wxString StrippedTranslation() const { return Stripped().Translation(); }
461 
462 private:
464 
465  // Construct a TranslatableString that does no translation but passes
466  // str verbatim
467  explicit TranslatableString( wxString str )
468  : mFormatter{ NullContextFormatter }
469  {
470  mMsgid.swap( str );
471  }
472 
473  friend TranslatableString Verbatim( wxString str );
474 
475  enum class Request {
476  Context, // return a disambiguating context string
477  Format, // Given the msgid, format the string for end users
478  DebugFormat, // Given the msgid, format the string for developers
479  };
480 
481  static const wxChar *const NullContextName;
483 
484  static wxString DoGetContext( const Formatter &formatter );
485  static wxString DoSubstitute(
486  const Formatter &formatter,
487  const wxString &format, const wxString &context, bool debug );
488  wxString DoFormat( bool debug ) const
489  { return DoSubstitute(
490  mFormatter, mMsgid, DoGetContext(mFormatter), debug ); }
491 
492  static wxString DoChooseFormat(
493  const Formatter &formatter,
494  const wxString &singular, const wxString &plural, unsigned nn, bool debug );
495 
496  template< typename T > static const T &TranslateArgument( const T &arg, bool )
497  { return arg; }
498  // This allows you to wrap arguments of Format in std::cref so that they
499  // are captured (as if) by reference rather than by value
500  template< typename T > static auto TranslateArgument(
501  const std::reference_wrapper<T> &arg, bool debug )
502  -> decltype(
503  TranslatableString::TranslateArgument( arg.get(), debug ) )
504  { return TranslatableString::TranslateArgument( arg.get(), debug ); }
505  static wxString TranslateArgument( const TranslatableString &arg, bool debug )
506  { return arg.DoFormat( debug ); }
507 
508  template< size_t N > struct PluralTemp{
510  const wxString &pluralStr;
511  template< typename... Args >
512  TranslatableString &&operator()( Args&&... args )
513  {
514  // Pick from the pack the argument that specifies number
515  auto selector =
516  std::template get< N >( std::forward_as_tuple( args... ) );
517  // We need an unsigned value. Guard against negative values.
518  auto nn = static_cast<unsigned>(
519  std::max<unsigned long long>( 0, selector )
520  );
521  auto plural = this->pluralStr;
522  auto prevFormatter = this->ts.mFormatter;
523  this->ts.mFormatter = [prevFormatter, plural, nn, args...]
524  (const wxString &str, Request request) -> wxString {
525  switch ( request ) {
526  case Request::Context:
527  return TranslatableString::DoGetContext( prevFormatter );
528  case Request::Format:
529  case Request::DebugFormat:
530  default:
531  {
532  bool debug = request == Request::DebugFormat;
533  return wxString::Format(
535  prevFormatter, str, plural, nn, debug ),
536  TranslatableString::TranslateArgument( args, debug )...
537  );
538  }
539  }
540  };
541  return std::move(ts);
542  }
543  };
544 
545  wxString mMsgid;
547 };
548 
551 {
552  return std::move(x += std::move(y));
553 }
554 
555 using TranslatableStrings = std::vector<TranslatableString>;
556 
557 // For using std::unordered_map on TranslatableString
558 // Note: hashing on msgids only, which is not all of the information
559 namespace std
560 {
561  template<> struct hash< TranslatableString > {
562  size_t operator () (const TranslatableString &str) const // noexcept
563  {
564  const wxString &stdstr = str.mMsgid.ToStdWstring(); // no allocations, a cheap fetch
565  using Hasher = hash< wxString >;
566  return Hasher{}( stdstr );
567  }
568  };
569 }
570 
571 // Allow TranslatableString to work with shift output operators
572 template< typename Sink >
573 inline Sink &operator <<( Sink &sink, const TranslatableString &str )
574 {
575  return sink << str.Translation();
576 }
577 
578 // Require calls to the one-argument constructor to go through this
579 // distinct global function name. This makes it easier to locate and
580 // review the uses of this function, separately from the uses of the type.
581 inline TranslatableString Verbatim( wxString str )
582 { return TranslatableString( std::move( str ) ); }
583 
584 // ----------------------------------------------------------------------------
585 // A native 64-bit integer...used when referring to any number of samples
586 // ----------------------------------------------------------------------------
587 
589 {
590 public:
591  using type = long long;
592  static_assert(sizeof(type) == 8, "Wrong width of sampleCount");
593 
594  sampleCount () : value { 0 } {}
595 
596  // Allow implicit conversion from integral types
597  sampleCount ( type v ) : value { v } {}
598  sampleCount ( unsigned long long v ) : value ( v ) {}
599  sampleCount ( int v ) : value { v } {}
600  sampleCount ( unsigned v ) : value { v } {}
601  sampleCount ( long v ) : value { v } {}
602 
603  // unsigned long is 64 bit on some platforms. Let it narrow.
604  sampleCount ( unsigned long v ) : value ( v ) {}
605 
606  // Beware implicit conversions from floating point values!
607  // Otherwise the meaning of binary operators with sampleCount change
608  // their meaning when sampleCount is not an alias!
609  explicit sampleCount ( float f ) : value ( f ) {}
610  explicit sampleCount ( double d ) : value ( d ) {}
611 
612  sampleCount ( const sampleCount& ) = default;
613  sampleCount &operator= ( const sampleCount& ) = default;
614 
615  float as_float() const { return value; }
616  double as_double() const { return value; }
617 
618  long long as_long_long() const { return value; }
619 
620  size_t as_size_t() const {
621  wxASSERT(value >= 0);
622  wxASSERT(static_cast<std::make_unsigned<type>::type>(value) <= std::numeric_limits<size_t>::max());
623  return value;
624  }
625 
626  sampleCount &operator += (sampleCount b) { value += b.value; return *this; }
627  sampleCount &operator -= (sampleCount b) { value -= b.value; return *this; }
628  sampleCount &operator *= (sampleCount b) { value *= b.value; return *this; }
629  sampleCount &operator /= (sampleCount b) { value /= b.value; return *this; }
630  sampleCount &operator %= (sampleCount b) { value %= b.value; return *this; }
631 
632  sampleCount operator - () const { return -value; }
633 
634  sampleCount &operator ++ () { ++value; return *this; }
636  { sampleCount result{ *this }; ++value; return result; }
637 
638  sampleCount &operator -- () { --value; return *this; }
640  { sampleCount result{ *this }; --value; return result; }
641 
642 private:
644 };
645 
647 {
648  return a.as_long_long() == b.as_long_long();
649 }
650 
652 {
653  return !(a == b);
654 }
655 
657 {
658  return a.as_long_long() < b.as_long_long();
659 }
660 
662 {
663  return !(a < b);
664 }
665 
667 {
668  return b < a;
669 }
670 
672 {
673  return !(b < a);
674 }
675 
677 {
678  return sampleCount{ a } += b;
679 }
680 
682 {
683  return sampleCount{ a } -= b;
684 }
685 
687 {
688  return sampleCount{ a } *= b;
689 }
690 
692 {
693  return sampleCount{ a } /= b;
694 }
695 
697 {
698  return sampleCount{ a } %= b;
699 }
700 
701 // ----------------------------------------------------------------------------
702 // Function returning the minimum of a sampleCount and a size_t,
703 // hiding the casts
704 // ----------------------------------------------------------------------------
705 
706 inline size_t limitSampleBufferSize( size_t bufferSize, sampleCount limit )
707 {
708  return
709  std::min( sampleCount( bufferSize ), std::max( sampleCount(0), limit ) )
710  .as_size_t();
711 }
712 
713 // ----------------------------------------------------------------------------
714 // Supported sample formats
715 // ----------------------------------------------------------------------------
716 enum sampleFormat : unsigned
717 {
720  int16Sample = 0x00020001,
721  int24Sample = 0x00040001,
722  floatSample = 0x0004000F,
723 
727 };
728 
729 // ----------------------------------------------------------------------------
730 // Provide the number of bytes a specific sample will take
731 // ----------------------------------------------------------------------------
732 #define SAMPLE_SIZE(SampleFormat) (SampleFormat >> 16)
733 
734 // ----------------------------------------------------------------------------
735 // Generic pointer to sample data
736 // ----------------------------------------------------------------------------
737 typedef char *samplePtr;
738 typedef const char *constSamplePtr;
739 
740 // ----------------------------------------------------------------------------
741 // The type for plugin IDs
742 // ----------------------------------------------------------------------------
743 typedef wxString PluginID;
744 
745 // ----------------------------------------------------------------------------
746 // Supported channel assignments
747 // ----------------------------------------------------------------------------
748 
749 typedef enum
750 {
751  // Use to mark end of list
753  // The default channel assignment
755  // From this point, the channels follow the 22.2 surround sound format
781 
782 // ----------------------------------------------------------------------------
783 // some frequently needed forward declarations
784 // ----------------------------------------------------------------------------
785 
787 
790 
792 
794 
795 #endif // __AUDACITY_TYPES_H__
ChannelNameBackCenter
@ ChannelNameBackCenter
Definition: Types.h:764
sampleCount::operator%=
sampleCount & operator%=(sampleCount b)
Definition: Types.h:630
RegistryPaths
std::vector< RegistryPath > RegistryPaths
Definition: Types.h:262
FileExtension
wxString FileExtension
Definition: Types.h:267
TranslatableString
Definition: Types.h:290
operator==
bool operator==(const Identifier &x, const Identifier &y)
Definition: Types.h:119
TranslatableString::PluralTemp::operator()
TranslatableString && operator()(Args &&... args)
Definition: Types.h:512
sampleCount::operator-
sampleCount operator-() const
Definition: Types.h:632
TranslatableString::Join
TranslatableString && Join(TranslatableString arg, const wxString &separator={}) &&
Definition: Types.h:424
ChannelNameTopCenter
@ ChannelNameTopCenter
Definition: Types.h:771
TaggedIdentifier::CONVERT
String CONVERT() const
Definition: Types.h:189
TranslatableString::empty
bool empty() const
Definition: Types.h:329
ChannelNameBackRight
@ ChannelNameBackRight
Definition: Types.h:761
ChannelNameMono
@ ChannelNameMono
Definition: Types.h:754
ChannelNameFrontRightCenter
@ ChannelNameFrontRightCenter
Definition: Types.h:763
TranslatableString::DoGetContext
static wxString DoGetContext(const Formatter &formatter)
Definition: Internat.cpp:358
PluginPaths
std::vector< PluginPath > PluginPaths
Definition: Types.h:258
TranslatableString::Context
TranslatableString & Context(const wxString &context) &
Definition: Types.h:398
TranslatableString::Format
TranslatableString && Format(Args &&...args) &&
Definition: Types.h:388
constSamplePtr
const char * constSamplePtr
Definition: Types.h:738
operator!=
bool operator!=(const Identifier &x, const Identifier &y)
Definition: Types.h:122
sampleCount::operator++
sampleCount & operator++()
Definition: Types.h:634
int24Sample
@ int24Sample
Definition: Types.h:721
TranslatableString::PluralTemp::ts
TranslatableString & ts
Definition: Types.h:509
Format
Abstract base class used in importing a file.
Identifier::Identifier
Identifier()=default
ChannelNameTopFrontRight
@ ChannelNameTopFrontRight
Definition: Types.h:769
TranslatableString::Request
Request
Definition: Types.h:475
TranslatableString::Inaudible
static const TranslatableString Inaudible
Definition: Types.h:292
operator-
sampleCount operator-(sampleCount a, sampleCount b)
Definition: Types.h:681
TranslatableString::PluralTemp::pluralStr
const wxString & pluralStr
Definition: Types.h:510
wxToString
wxString wxToString(const Identifier &str)
Definition: Types.h:150
ChannelNameTopFrontLeft
@ ChannelNameTopFrontLeft
Definition: Types.h:768
PluginID
wxString PluginID
Definition: Types.h:743
floatSample
@ floatSample
Definition: Types.h:722
TranslatableString::Debug
wxString Debug() const
Definition: Types.h:341
TranslatableString::NullContextFormatter
static const Formatter NullContextFormatter
Definition: Types.h:463
TaggedIdentifier::TaggedIdentifier
TaggedIdentifier(const TaggedIdentifier< Tag2, b > &)=delete
ComponentInterfaceSymbol::ComponentInterfaceSymbol
ComponentInterfaceSymbol()=default
TranslatableString::StripOptions
StripOptions
Definition: Types.h:447
std::hash< TranslatableString >
Definition: Types.h:561
wxArrayStringEx::wxArrayStringEx
wxArrayStringEx()=default
TaggedIdentifier::TaggedIdentifier
TaggedIdentifier(TaggedIdentifier< Tag2, b > &&)=delete
sampleCount::as_float
float as_float() const
Definition: Types.h:615
ChannelNameFrontLeftCenter
@ ChannelNameFrontLeftCenter
Definition: Types.h:762
wxArrayStringEx
Definition: MemoryX.h:663
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterface.h:60
TranslatableString::DoChooseFormat
static wxString DoChooseFormat(const Formatter &formatter, const wxString &singular, const wxString &plural, unsigned nn, bool debug)
Definition: Internat.cpp:372
ChannelNameTopSideRight
@ ChannelNameTopSideRight
Definition: Types.h:775
ChannelNameFrontLeft
@ ChannelNameFrontLeft
Definition: Types.h:756
ChannelNameLowFrequency2
@ ChannelNameLowFrequency2
Definition: Types.h:765
TaggedIdentifier< CommandIdTag, false >::TagType
CommandIdTag TagType
Definition: Types.h:161
Identifier::operator=
Identifier & operator=(const Identifier &)=default
operator<
bool operator<(const Identifier &x, const Identifier &y)
Definition: Types.h:125
limitSampleBufferSize
size_t limitSampleBufferSize(size_t bufferSize, sampleCount limit)
Definition: Types.h:706
TranslatableString::Strip
TranslatableString && Strip(unsigned options=MenuCodes) &&
Definition: Types.h:453
ChannelNameBottomFrontLeft
@ ChannelNameBottomFrontLeft
Definition: Types.h:778
TaggedIdentifier::TaggedIdentifier
TaggedIdentifier(TaggedIdentifier &&)=default
Identifier
Definition: Types.h:64
operator%
sampleCount operator%(sampleCount a, sampleCount b)
Definition: Types.h:696
TaggedIdentifier::TaggedIdentifier
TaggedIdentifier()=default
TranslatableString::Strip
TranslatableString & Strip(unsigned options=MenuCodes) &
Definition: Internat.cpp:324
Identifier::split
std::vector< Identifier > split(wxChar separator) const
Definition: Internat.cpp:297
TranslatableString::DoFormat
wxString DoFormat(bool debug) const
Definition: Types.h:488
TranslatableStrings
std::vector< TranslatableString > TranslatableStrings
Definition: Types.h:555
ChannelName
ChannelName
Definition: Types.h:750
operator<<
Sink & operator<<(Sink &sink, const TranslatableString &str)
Definition: Types.h:573
samplePtr
char * samplePtr
Definition: Types.h:737
TranslatableString::TranslatableString
TranslatableString(const TranslatableString &)=default
sampleFormat
sampleFormat
Definition: Types.h:717
ChannelNameEOL
@ ChannelNameEOL
Definition: Types.h:752
sampleCount::as_double
double as_double() const
Definition: Types.h:616
TranslatableString::mFormatter
Formatter mFormatter
Definition: Types.h:546
operator>
bool operator>(const Identifier &x, const Identifier &y)
Definition: Types.h:128
TranslatableString::DoSubstitute
static wxString DoSubstitute(const Formatter &formatter, const wxString &format, const wxString &context, bool debug)
Definition: Internat.cpp:363
sampleCount::as_long_long
long long as_long_long() const
Definition: Types.h:618
ChannelNameBottomFrontRight
@ ChannelNameBottomFrontRight
Definition: Types.h:779
TaggedIdentifier::TaggedIdentifier
TaggedIdentifier(const Identifier &str)
Definition: Types.h:185
ChannelNames
enum ChannelName * ChannelNames
TranslatableString::TranslateArgument
static const T & TranslateArgument(const T &arg, bool)
Definition: Types.h:496
TaggedIdentifier::TaggedIdentifier
TaggedIdentifier(const TaggedIdentifier &)=default
narrowestSampleFormat
@ narrowestSampleFormat
Two synonyms for previous values that might change if more values were added.
Definition: Types.h:725
sampleCount::sampleCount
sampleCount(unsigned long long v)
Definition: Types.h:598
TranslatableString::TranslatableString
TranslatableString(TranslatableString &&str)
Definition: Types.h:317
sampleCount::sampleCount
sampleCount(type v)
Definition: Types.h:597
PluginPath
wxString PluginPath
type alias for identifying a Plugin supplied by a module, each module defining its own interpretation...
Definition: Types.h:257
sampleCount::sampleCount
sampleCount(unsigned v)
Definition: Types.h:600
operator+
TranslatableString operator+(TranslatableString x, TranslatableString y)
Definition: Types.h:549
format
int format
Definition: ExportPCM.cpp:54
ChannelNameLowFrequency1
@ ChannelNameLowFrequency1
Definition: Types.h:759
Identifier::value
wxString value
Definition: Types.h:115
Identifier::length
size_t length() const
Definition: Types.h:106
ChannelNameTopSideLeft
@ ChannelNameTopSideLeft
Definition: Types.h:774
ChannelNameTopBackLeft
@ ChannelNameTopBackLeft
Definition: Types.h:772
sampleCount::sampleCount
sampleCount()
Definition: Types.h:594
TranslatableString::operator=
TranslatableString & operator=(TranslatableString &&str)
Definition: Types.h:322
sampleCount::type
long long type
Definition: Types.h:591
operator>=
bool operator>=(const Identifier &x, const Identifier &y)
Definition: Types.h:134
Identifier::size
size_t size() const
Definition: Types.h:105
ChannelNameTopBackRight
@ ChannelNameTopBackRight
Definition: Types.h:773
sampleCount::as_size_t
size_t as_size_t() const
Definition: Types.h:620
TaggedIdentifier::operator=
TaggedIdentifier & operator=(const TaggedIdentifier &)=default
sampleCount::operator--
sampleCount & operator--()
Definition: Types.h:638
Identifier::GET
const wxString & GET() const
Definition: Types.h:110
TranslatableString::TranslateArgument
static auto TranslateArgument(const std::reference_wrapper< T > &arg, bool debug) -> decltype(TranslatableString::TranslateArgument(arg.get(), debug))
Definition: Types.h:500
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
sampleCount::sampleCount
sampleCount(long v)
Definition: Types.h:601
FilePath
wxString FilePath
Definition: Types.h:270
sampleCount::sampleCount
sampleCount(double d)
Definition: Types.h:610
TranslatableString::TranslatableString
TranslatableString()
Definition: Types.h:304
sampleCount::sampleCount
sampleCount(unsigned long v)
Definition: Types.h:604
TaggedIdentifier
Definition: Types.h:158
TranslatableString::Plural
PluralTemp< N > Plural(const wxString &pluralStr) &&
Definition: Types.h:439
sampleCount
Definition: Types.h:589
TranslatableString::mMsgid
wxString mMsgid
Definition: Types.h:545
Verbatim
TranslatableString Verbatim(wxString str)
Definition: Types.h:581
sampleCount::operator=
sampleCount & operator=(const sampleCount &)=default
ChannelNameSideRight
@ ChannelNameSideRight
Definition: Types.h:767
TranslatableString::StrippedTranslation
wxString StrippedTranslation() const
Definition: Types.h:460
Identifier::swap
void swap(Identifier &id)
Definition: Types.h:95
int16Sample
@ int16Sample
Definition: Types.h:720
sampleCount::value
type value
Definition: Types.h:643
sampleCount::sampleCount
sampleCount(int v)
Definition: Types.h:599
CommandIDs
std::vector< CommandID > CommandIDs
Definition: Types.h:277
operator/
sampleCount operator/(sampleCount a, sampleCount b)
Definition: Types.h:691
TranslatableString::MSGID
Identifier MSGID() const
Definition: Types.h:335
ChannelNameSideLeft
@ ChannelNameSideLeft
Definition: Types.h:766
wxFromString
bool wxFromString(const wxString &str, Identifier *id)
Definition: Types.h:146
sampleCount::sampleCount
sampleCount(const sampleCount &)=default
TranslatableString::Translation
wxString Translation() const
Definition: Types.h:337
RegistryPath
wxString RegistryPath
Definition: Types.h:261
TranslatableString::Format
TranslatableString & Format(Args &&...args) &
Definition: Types.h:363
ChannelNameFrontCenter
@ ChannelNameFrontCenter
Definition: Types.h:758
ChannelNameFrontRight
@ ChannelNameFrontRight
Definition: Types.h:757
sampleCount::operator-=
sampleCount & operator-=(sampleCount b)
Definition: Types.h:627
TranslatableString::Stripped
TranslatableString Stripped(unsigned options=MenuCodes) const
Definition: Types.h:457
TranslatableString::operator=
TranslatableString & operator=(const TranslatableString &)=default
TranslatableString::Formatter
std::function< wxString(const wxString &, Request) > Formatter
Definition: Types.h:302
ChannelNameBackLeft
@ ChannelNameBackLeft
Definition: Types.h:760
operator<=
bool operator<=(const Identifier &x, const Identifier &y)
Definition: Types.h:131
widestSampleFormat
@ widestSampleFormat
Definition: Types.h:726
TranslatableString::TranslatableString
TranslatableString(wxString str)
Definition: Types.h:467
TranslatableString::Context
TranslatableString && Context(const wxString &context) &&
Definition: Types.h:414
sampleCount::operator/=
sampleCount & operator/=(sampleCount b)
Definition: Types.h:629
ChannelNameTopFrontCenter
@ ChannelNameTopFrontCenter
Definition: Types.h:770
operator*
sampleCount operator*(sampleCount a, sampleCount b)
Definition: Types.h:686
sampleCount::operator*=
sampleCount & operator*=(sampleCount b)
Definition: Types.h:628
Identifier::empty
bool empty() const
Definition: Types.h:104
TranslatableString::NullContextName
static const wxChar *const NullContextName
Definition: Types.h:481
sampleCount::sampleCount
sampleCount(float f)
Definition: Types.h:609
ChannelNameTopBackCenter
@ ChannelNameTopBackCenter
Definition: Types.h:776
ChannelNameBottomFrontCenter
@ ChannelNameBottomFrontCenter
Definition: Types.h:777
TranslatableString::TranslateArgument
static wxString TranslateArgument(const TranslatableString &arg, bool debug)
Definition: Types.h:505
TranslatableString::PluralTemp
Definition: Types.h:508
TranslatableString::TranslatableString
TranslatableString(wxString str, Formatter formatter)
Definition: Types.h:308
sampleCount::operator+=
sampleCount & operator+=(sampleCount b)
Definition: Types.h:626
EnumValueSymbol
ComponentInterfaceSymbol EnumValueSymbol
Definition: Types.h:788