RenderManager.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * RenderManager.h - Provides a uniform interface for rendering the project or
  3. * individual tracks for the CLI and GUI.
  4. *
  5. * Copyright (c) 2015 Ryan Roden-Corrent <ryan/at/rcorre.net>
  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 RENDER_MANAGER_H
  26. #define RENDER_MANAGER_H
  27. #include <memory>
  28. #include "ProjectRenderer.h"
  29. #include "OutputSettings.h"
  30. class RenderManager : public QObject
  31. {
  32. Q_OBJECT
  33. public:
  34. RenderManager(
  35. const AudioEngine::qualitySettings & qualitySettings,
  36. const OutputSettings & outputSettings,
  37. ProjectRenderer::ExportFileFormats fmt,
  38. QString outputPath);
  39. virtual ~RenderManager();
  40. /// Export all unmuted tracks into a single file
  41. void renderProject();
  42. /// Export all unmuted tracks into individual file
  43. void renderTracks();
  44. void abortProcessing();
  45. signals:
  46. void progressChanged( int );
  47. void finished();
  48. private slots:
  49. void renderNextTrack();
  50. void updateConsoleProgress();
  51. private:
  52. QString pathForTrack( const Track *track, int num );
  53. void restoreMutedState();
  54. void render( QString outputPath );
  55. const AudioEngine::qualitySettings m_qualitySettings;
  56. const AudioEngine::qualitySettings m_oldQualitySettings;
  57. const OutputSettings m_outputSettings;
  58. ProjectRenderer::ExportFileFormats m_format;
  59. QString m_outputPath;
  60. std::unique_ptr<ProjectRenderer> m_activeRenderer;
  61. QVector<Track*> m_tracksToRender;
  62. QVector<Track*> m_unmuted;
  63. } ;
  64. #endif