mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 17:01:08 +02:00
audioplayer. add streamripper control to record current stream
Origin commit data
------------------
Branch: ni/coolstream
Commit: 24affa8a8b
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-08-17 (Thu, 17 Aug 2017)
Origin message was:
------------------
- audioplayer. add streamripper control to record current stream
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -216,7 +216,7 @@ CAudioPlayerGui::~CAudioPlayerGui()
|
||||
delete m_titlebox;
|
||||
}
|
||||
|
||||
const struct button_label AudioPlayerButtons[][4] =
|
||||
/*const*/ struct button_label AudioPlayerButtons[][4] =
|
||||
{
|
||||
{
|
||||
{ NEUTRINO_ICON_BUTTON_STOP , LOCALE_AUDIOPLAYER_STOP },
|
||||
@@ -249,6 +249,7 @@ const struct button_label AudioPlayerButtons[][4] =
|
||||
{
|
||||
{ NEUTRINO_ICON_BUTTON_STOP , LOCALE_AUDIOPLAYER_STOP },
|
||||
{ NEUTRINO_ICON_BUTTON_PAUSE , LOCALE_AUDIOPLAYER_PAUSE },
|
||||
{ NEUTRINO_ICON_BUTTON_RECORD_ACTIVE, LOCALE_AUDIOPLAYER_STREAMRIPPER_START },
|
||||
},
|
||||
{
|
||||
{ NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_ADD },
|
||||
@@ -321,6 +322,9 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
m_idletime = time(NULL);
|
||||
m_screensaver = false;
|
||||
|
||||
m_streamripper_available = !find_executable("streamripper").empty() && !find_executable("streamripper.sh").empty();
|
||||
m_streamripper_active = false;
|
||||
|
||||
if (parent)
|
||||
parent->hide();
|
||||
|
||||
@@ -838,6 +842,32 @@ int CAudioPlayerGui::show()
|
||||
update = true;
|
||||
}
|
||||
}
|
||||
else if (msg == (neutrino_msg_t) g_settings.key_record)
|
||||
{
|
||||
if (m_key_level == 1)
|
||||
{
|
||||
if (m_curr_audiofile.FileType == CFile::STREAM_AUDIO && m_streamripper_available)
|
||||
{
|
||||
if (m_streamripper_active)
|
||||
{
|
||||
ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_AUDIOPLAYER_STREAMRIPPER_STOP, HINTBOX_MIN_WIDTH, 2);
|
||||
my_system(2, "streamripper.sh", "stop");
|
||||
m_streamripper_active = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_AUDIOPLAYER_STREAMRIPPER_START, HINTBOX_MIN_WIDTH, 2);
|
||||
printf("streamripper.sh start \"%s\"\n", m_playlist[m_current].MetaData.url.c_str());
|
||||
puts("[audioplayer.cpp] executing streamripper");
|
||||
if (my_system(3, "streamripper.sh", "start", m_playlist[m_current].MetaData.url.c_str()) != 0)
|
||||
perror("[audioplayer.cpp]: streamripper.sh failed\n");
|
||||
else
|
||||
m_streamripper_active = true;
|
||||
}
|
||||
update = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (CRCInput::isNumeric(msg) && !(m_playlist.empty()))
|
||||
{ //numeric zap or SMS zap
|
||||
if (m_select_title_by_name)
|
||||
@@ -1730,7 +1760,18 @@ void CAudioPlayerGui::paintFoot()
|
||||
if (m_curr_audiofile.FileType != CFile::STREAM_AUDIO)
|
||||
::paintButtons(button_x, button_y, button_width, 4, AudioPlayerButtons[0], button_width, m_button_height);
|
||||
else
|
||||
::paintButtons(button_x, button_y, button_width, 2, AudioPlayerButtons[6], button_width, m_button_height);
|
||||
{
|
||||
int b = 2;
|
||||
if (m_streamripper_available)
|
||||
{
|
||||
b = 3;
|
||||
if (m_streamripper_active)
|
||||
AudioPlayerButtons[6][2].locale = LOCALE_AUDIOPLAYER_STREAMRIPPER_STOP;
|
||||
else
|
||||
AudioPlayerButtons[6][2].locale = LOCALE_AUDIOPLAYER_STREAMRIPPER_START;
|
||||
}
|
||||
::paintButtons(button_x, button_y, button_width, b, AudioPlayerButtons[6], button_width, m_button_height);
|
||||
}
|
||||
}
|
||||
else // key_level == 2
|
||||
{
|
||||
@@ -2028,6 +2069,13 @@ void CAudioPlayerGui::stop()
|
||||
|
||||
if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP)
|
||||
CAudioPlayer::getInstance()->stop();
|
||||
|
||||
if (m_streamripper_active)
|
||||
{
|
||||
ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_AUDIOPLAYER_STREAMRIPPER_STOP, HINTBOX_MIN_WIDTH, 2);
|
||||
my_system(2, "streamripper.sh", "stop");
|
||||
m_streamripper_active = false;
|
||||
}
|
||||
}
|
||||
|
||||
void CAudioPlayerGui::pause()
|
||||
|
Reference in New Issue
Block a user