Commit 50606d8f authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: react to recording event from the core by activating the button.

parent a6b0ee0b
...@@ -307,6 +307,9 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options ) ...@@ -307,6 +307,9 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
CONNECT_MAP_SET( recordButton, RECORD_ACTION ); CONNECT_MAP_SET( recordButton, RECORD_ACTION );
BUTTON_SET_BAR( recordButton ); BUTTON_SET_BAR( recordButton );
ENABLE_ON_INPUT( recordButton ); ENABLE_ON_INPUT( recordButton );
recordButton->setCheckable( true );
CONNECT( THEMIM->getIM(), recordingStateChanged( bool ),
recordButton, setChecked( bool ) );
widget = recordButton; widget = recordButton;
} }
break; break;
......
...@@ -156,7 +156,8 @@ void InputManager::customEvent( QEvent *event ) ...@@ -156,7 +156,8 @@ void InputManager::customEvent( QEvent *event )
i_type != SynchroChanged_Type && i_type != SynchroChanged_Type &&
i_type != CachingEvent_Type && i_type != CachingEvent_Type &&
i_type != BookmarksChanged_Type && i_type != BookmarksChanged_Type &&
i_type != InterfaceAoutUpdate_Type ) i_type != InterfaceAoutUpdate_Type &&
i_type != RecordingEvent_Type )
return; return;
if( !hasInput() ) return; if( !hasInput() ) return;
...@@ -176,7 +177,8 @@ void InputManager::customEvent( QEvent *event ) ...@@ -176,7 +177,8 @@ void InputManager::customEvent( QEvent *event )
i_type != InfoChanged_Type && i_type != InfoChanged_Type &&
i_type != SynchroChanged_Type && i_type != SynchroChanged_Type &&
i_type != BookmarksChanged_Type && i_type != BookmarksChanged_Type &&
i_type != InterfaceAoutUpdate_Type i_type != InterfaceAoutUpdate_Type &&
i_type != RecordingEvent_Type
) )
&& ( i_input_id != ple->i_id ) ) && ( i_input_id != ple->i_id ) )
return; return;
...@@ -247,6 +249,9 @@ void InputManager::customEvent( QEvent *event ) ...@@ -247,6 +249,9 @@ void InputManager::customEvent( QEvent *event )
case InterfaceAoutUpdate_Type: case InterfaceAoutUpdate_Type:
UpdateAout(); UpdateAout();
break; break;
case RecordingEvent_Type:
UpdateRecord();
break;
default: default:
msg_Warn( p_intf, "This shouldn't happen: %i", i_type ); msg_Warn( p_intf, "This shouldn't happen: %i", i_type );
} }
...@@ -340,10 +345,8 @@ static int InputEvent( vlc_object_t *p_this, const char *, ...@@ -340,10 +345,8 @@ static int InputEvent( vlc_object_t *p_this, const char *,
break; break;
case INPUT_EVENT_RECORD: case INPUT_EVENT_RECORD:
/* This happens when a recording starts. What do we do then? event = new IMEvent( RecordingEvent_Type, 0 );
Display a red light? */ break;
/* event = new IMEvent( RecordingEvent_Type, 0 );
break; */
case INPUT_EVENT_PROGRAM: case INPUT_EVENT_PROGRAM:
/* This is for PID changes */ /* This is for PID changes */
...@@ -585,6 +588,14 @@ inline void InputManager::UpdateInfo() ...@@ -585,6 +588,14 @@ inline void InputManager::UpdateInfo()
emit infoChanged( input_GetItem( p_input ) ); emit infoChanged( input_GetItem( p_input ) );
} }
void InputManager::UpdateRecord()
{
if( hasInput() )
{
emit recordingStateChanged( var_GetBool( p_input, "record" ) );
}
}
/* User update of the slider */ /* User update of the slider */
void InputManager::sliderUpdate( float new_pos ) void InputManager::sliderUpdate( float new_pos )
{ {
......
...@@ -57,8 +57,8 @@ enum { ...@@ -57,8 +57,8 @@ enum {
SynchroChanged_Type, SynchroChanged_Type,
CachingEvent_Type, CachingEvent_Type,
BookmarksChanged_Type, BookmarksChanged_Type,
/* RecordingEvent_Type, RecordingEvent_Type,
ProgramChanged_Type, /* ProgramChanged_Type,
SignalChanged_Type, */ SignalChanged_Type, */
FullscreenControlToggle_Type = QEvent::User + IMEventType + 20, FullscreenControlToggle_Type = QEvent::User + IMEventType + 20,
...@@ -133,6 +133,7 @@ private: ...@@ -133,6 +133,7 @@ private:
void UpdateAout(); void UpdateAout();
void UpdateStats(); void UpdateStats();
void UpdateCaching(); void UpdateCaching();
void UpdateRecord();
void AtoBLoop( int ); void AtoBLoop( int );
...@@ -175,6 +176,7 @@ signals: ...@@ -175,6 +176,7 @@ signals:
void artChanged( QString ); void artChanged( QString );
/// Play/pause status /// Play/pause status
void statusChanged( int ); void statusChanged( int );
void recordingStateChanged( bool );
/// Teletext /// Teletext
void teletextPossible( bool ); void teletextPossible( bool );
void teletextActivated( bool ); void teletextActivated( bool );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment