-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement MP3 encoding support Conflicts: .travis/linux..install.sh .travis/osx..install.sh
- Loading branch information
1 parent
cb68c96
commit ca5d2b6
Showing
17 changed files
with
402 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# - Try to find LAME | ||
# Once done this will define | ||
# | ||
# LAME_FOUND - system has liblame | ||
# LAME_INCLUDE_DIRS - the liblame include directory | ||
# LAME_LIBRARIES - The liblame libraries | ||
|
||
find_path(LAME_INCLUDE_DIRS lame/lame.h) | ||
find_library(LAME_LIBRARIES mp3lame) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Lame DEFAULT_MSG LAME_INCLUDE_DIRS LAME_LIBRARIES) | ||
|
||
list(APPEND LAME_DEFINITIONS -DHAVE_LIBMP3LAME=1) | ||
|
||
mark_as_advanced(LAME_INCLUDE_DIRS LAME_LIBRARIES LAME_DEFINITIONS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* AudioFileMP3.h - Audio-device which encodes a wave stream into | ||
* an MP3 file. This is used for song export. | ||
* | ||
* Copyright (c) 2017 to present Michael Gregorius <michael.gregorius.git/at/arcor[dot]de> | ||
* | ||
* This file is part of LMMS - https://lmms.io | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public | ||
* License along with this program (see COPYING); if not, write to the | ||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
* Boston, MA 02110-1301 USA. | ||
* | ||
*/ | ||
|
||
#ifndef AUDIO_FILE_MP3_H | ||
#define AUDIO_FILE_MP3_H | ||
|
||
#include "lmmsconfig.h" | ||
|
||
#ifdef LMMS_HAVE_MP3LAME | ||
|
||
#include "AudioFileDevice.h" | ||
|
||
#include "lame/lame.h" | ||
|
||
|
||
class AudioFileMP3 : public AudioFileDevice | ||
{ | ||
public: | ||
AudioFileMP3( OutputSettings const & outputSettings, | ||
const ch_cnt_t _channels, | ||
bool & successful, | ||
const QString & _file, | ||
Mixer* mixer ); | ||
virtual ~AudioFileMP3(); | ||
|
||
static AudioFileDevice * getInst( const QString & outputFilename, | ||
OutputSettings const & outputSettings, | ||
const ch_cnt_t channels, | ||
Mixer* mixer, | ||
bool & successful ) | ||
{ | ||
return new AudioFileMP3( outputSettings, channels, successful, | ||
outputFilename, mixer ); | ||
} | ||
|
||
protected: | ||
virtual void writeBuffer( const surroundSampleFrame * /* _buf*/, | ||
const fpp_t /*_frames*/, | ||
const float /*_master_gain*/ ); | ||
|
||
private: | ||
void flushRemainingBuffers(); | ||
bool initEncoder(); | ||
void tearDownEncoder(); | ||
|
||
private: | ||
lame_t m_lame; | ||
}; | ||
|
||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.