OutputSettings.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * OutputSettings.h - Stores the settings for file rendering
  3. *
  4. * Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
  5. * Copyright (c) 2017 Michael Gregorius <michael.gregorius.git/at/arcor[dot]de>
  6. *
  7. * This file is part of LMMS - https://lmms.io
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public
  11. * License as published by the Free Software Foundation; either
  12. * version 2 of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public
  20. * License along with this program (see COPYING); if not, write to the
  21. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  22. * Boston, MA 02110-1301 USA.
  23. *
  24. */
  25. #ifndef OUTPUT_SETTINGS_H
  26. #define OUTPUT_SETTINGS_H
  27. class OutputSettings
  28. {
  29. public:
  30. enum BitDepth
  31. {
  32. Depth_16Bit,
  33. Depth_24Bit,
  34. Depth_32Bit,
  35. NumDepths
  36. };
  37. enum StereoMode
  38. {
  39. StereoMode_Stereo,
  40. StereoMode_JointStereo,
  41. StereoMode_Mono
  42. };
  43. class BitRateSettings
  44. {
  45. public:
  46. BitRateSettings(bitrate_t bitRate, bool isVariableBitRate) :
  47. m_bitRate(bitRate),
  48. m_isVariableBitRate(isVariableBitRate)
  49. {}
  50. bool isVariableBitRate() const { return m_isVariableBitRate; }
  51. void setVariableBitrate(bool variableBitRate = true) { m_isVariableBitRate = variableBitRate; }
  52. bitrate_t getBitRate() const { return m_bitRate; }
  53. void setBitRate(bitrate_t bitRate) { m_bitRate = bitRate; }
  54. private:
  55. bitrate_t m_bitRate;
  56. bool m_isVariableBitRate;
  57. };
  58. public:
  59. OutputSettings( sample_rate_t sampleRate,
  60. BitRateSettings const & bitRateSettings,
  61. BitDepth bitDepth,
  62. StereoMode stereoMode ) :
  63. m_sampleRate(sampleRate),
  64. m_bitRateSettings(bitRateSettings),
  65. m_bitDepth(bitDepth),
  66. m_stereoMode(stereoMode)
  67. {
  68. }
  69. OutputSettings( sample_rate_t sampleRate,
  70. BitRateSettings const & bitRateSettings,
  71. BitDepth bitDepth ) :
  72. OutputSettings(sampleRate, bitRateSettings, bitDepth, StereoMode_Stereo )
  73. {
  74. }
  75. sample_rate_t getSampleRate() const { return m_sampleRate; }
  76. void setSampleRate(sample_rate_t sampleRate) { m_sampleRate = sampleRate; }
  77. BitRateSettings const & getBitRateSettings() const { return m_bitRateSettings; }
  78. void setBitRateSettings(BitRateSettings const & bitRateSettings) { m_bitRateSettings = bitRateSettings; }
  79. BitDepth getBitDepth() const { return m_bitDepth; }
  80. void setBitDepth(BitDepth bitDepth) { m_bitDepth = bitDepth; }
  81. StereoMode getStereoMode() const { return m_stereoMode; }
  82. void setStereoMode(StereoMode stereoMode) { m_stereoMode = stereoMode; }
  83. private:
  84. sample_rate_t m_sampleRate;
  85. BitRateSettings m_bitRateSettings;
  86. BitDepth m_bitDepth;
  87. StereoMode m_stereoMode;
  88. };
  89. #endif