Compare commits

...

10 Commits

Author SHA1 Message Date
Michele Calgaro 38dcd28582
Use centralized cmake version
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit e097d43a06)
1 year ago
Michele Calgaro 81d30b1142
Replace Qt with TQt
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 00a73f1dea)
1 year ago
Michele Calgaro b023e03979
Use new TQ_METHOD, TQ_SIGNAL, TQ_SLOT defines
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 1ca6231ff7)
2 years ago
Slávek Banko 7c2b90bd69
Raise the minimum required version of CMake to 3.5.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 6208d03e3d)
2 years ago
TDE Gitea bf236a314c Update translation template. 2 years ago
Michele Calgaro 58bbed0510
xine engine: make volume control logarithmic for versions of xine < 1.2.13. For xine versions >= 1.2.13, libxine already makes the volume logarithmic. This relates to TDE/tdemultimedia#40.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit b5977d5e67)
2 years ago
TDE Gitea 79a8d17988 Update translation template. 2 years ago
Michele Calgaro d1d095a264
Fix volume slider functionality and visualization
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 1884d0e5a2)
2 years ago
Michele Calgaro decb99db2f
Replace Q_OBJECT with TQ_OBJECT
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit ea718087e4)
2 years ago
TDE Gitea 177cdfdd58 Merge translation files from master branch. 2 years ago

@ -9,7 +9,11 @@
# #
################################################# #################################################
cmake_minimum_required( VERSION 3.1 )
##### set project version ########################
include( TDEVersion )
cmake_minimum_required( VERSION ${TDE_CMAKE_MINIMUM_VERSION} )
##### include our cmake modules ################# ##### include our cmake modules #################

@ -7,7 +7,11 @@
############################################ ############################################
cmake_minimum_required( VERSION 3.1 ) ##### set project version ########################
include( TDEVersion )
cmake_minimum_required( VERSION ${TDE_CMAKE_MINIMUM_VERSION} )
tde_set_project_version( )
#### general package setup #### general package setup
@ -31,11 +35,6 @@ include( CheckCXXSourceCompiles )
include( TDEMacros ) include( TDEMacros )
##### set version number ########################
tde_set_project_version( )
##### setup install paths ##### setup install paths
include( TDESetupPaths ) include( TDESetupPaths )

@ -8,7 +8,7 @@
Playback finished message (amaroK statusbar code?) Playback finished message (amaroK statusbar code?)
Mouse move to show toolbar in fullscreen mode Mouse move to show toolbar in fullscreen mode
People are likely to use "F" keyboard shortcut or escape after film ends in fullscreen mode People are likely to use "F" keyboard shortcut or escape after film ends in fullscreen mode
but the popup of the menu prevents this, as for some reason Qt stops handling keyboard but the popup of the menu prevents this, as for some reason TQt stops handling keyboard
shortcuts. We need a solution. The escape issue makes the popup menu less useful. So shortcuts. We need a solution. The escape issue makes the popup menu less useful. So
escape with the menu should exit fullscreen too. All shortcuts in the menu should work. escape with the menu should exit fullscreen too. All shortcuts in the menu should work.
Shortcuts not in the menu shouldn't work as this is a modal menu! Could be dangerous. Shortcuts not in the menu shouldn't work as this is a modal menu! Could be dangerous.
@ -35,4 +35,4 @@
ACTION ACTION
xine config dialog is modal xine config dialog is modal
REACTION REACTION
none, at least yet, it is far easier to maintain modal dialogs none, at least yet, it is far easier to maintain modal dialogs

@ -49,7 +49,7 @@ application-specific options.
\*(T<\fB\-\-help\fR\*(T> \*(T<\fB\-\-help\fR\*(T>
Show help about options Show help about options
.TP .TP
\*(T<\fB\-\-help\-qt\fR\*(T> \*(T<\fB\-\-help\-tqt\fR\*(T>
Show TQt specific options Show TQt specific options
.TP .TP
\*(T<\fB\-\-help\-tde\fR\*(T> \*(T<\fB\-\-help\-tde\fR\*(T>

@ -29,12 +29,12 @@ namespace Codeine
setFrameStyle( TQFrame::Plain | TQFrame::Box ); setFrameStyle( TQFrame::Plain | TQFrame::Box );
m_preferred = new KPushButton( KGuiItem( i18n("Preferred Scale"), "viewmag" ), this ); m_preferred = new KPushButton( KGuiItem( i18n("Preferred Scale"), "viewmag" ), this );
connect( m_preferred, SIGNAL(clicked()), tqApp->mainWidget(), SLOT(adjustSize()) ); connect( m_preferred, TQ_SIGNAL(clicked()), tqApp->mainWidget(), TQ_SLOT(adjustSize()) );
connect( m_preferred, SIGNAL(clicked()), SLOT(deleteLater()) ); connect( m_preferred, TQ_SIGNAL(clicked()), TQ_SLOT(deleteLater()) );
m_oneToOne = new KPushButton( KGuiItem( i18n("Scale 100%"), "viewmag1" ), this ); m_oneToOne = new KPushButton( KGuiItem( i18n("Scale 100%"), "viewmag1" ), this );
connect( m_oneToOne, SIGNAL(clicked()), (TQObject*)videoWindow(), SLOT(resetZoom()) ); connect( m_oneToOne, TQ_SIGNAL(clicked()), (TQObject*)videoWindow(), TQ_SLOT(resetZoom()) );
connect( m_oneToOne, SIGNAL(clicked()), SLOT(deleteLater()) ); connect( m_oneToOne, TQ_SIGNAL(clicked()), TQ_SLOT(deleteLater()) );
TQBoxLayout *hbox = new TQHBoxLayout( this, 8, 6 ); TQBoxLayout *hbox = new TQHBoxLayout( this, 8, 6 );
TQBoxLayout *vbox = new TQVBoxLayout( hbox ); TQBoxLayout *vbox = new TQVBoxLayout( hbox );

@ -40,7 +40,7 @@ Analyzer::Base2D::Base2D( TQWidget *parent, uint timeout )
: Base<TQWidget>( parent, timeout ) : Base<TQWidget>( parent, timeout )
{ {
setWFlags( TQt::WNoAutoErase ); //no flicker setWFlags( TQt::WNoAutoErase ); //no flicker
connect( &m_timer, SIGNAL(timeout()), SLOT(draw()) ); connect( &m_timer, TQ_SIGNAL(timeout()), TQ_SLOT(draw()) );
} }
void void

@ -38,7 +38,7 @@ namespace Analyzer
class Base2D : public Base<TQWidget> class Base2D : public Base<TQWidget>
{ {
Q_OBJECT TQ_OBJECT
public: public:
const TQPixmap *canvas() const { return &m_canvas; } const TQPixmap *canvas() const { return &m_canvas; }

@ -73,11 +73,11 @@ public:
TQHBox *box = new TQHBox( this ); TQHBox *box = new TQHBox( this );
KPushButton *o = new KPushButton( KStdGuiItem::save(), box ); KPushButton *o = new KPushButton( KStdGuiItem::save(), box );
connect( o, SIGNAL(clicked()), SLOT(accept()) ); connect( o, TQ_SIGNAL(clicked()), TQ_SLOT(accept()) );
o = new KPushButton( KStdGuiItem::cancel(), box ); o = new KPushButton( KStdGuiItem::cancel(), box );
o->setText( i18n("Discard") ); o->setText( i18n("Discard") );
connect( o, SIGNAL(clicked()), SLOT(reject()) ); connect( o, TQ_SIGNAL(clicked()), TQ_SLOT(reject()) );
setCaption( i18n("Capture - %1").arg( time ) ); setCaption( i18n("Capture - %1").arg( time ) );
setFixedSize( sizeHint() ); setFixedSize( sizeHint() );
@ -178,7 +178,7 @@ yv12ToRgb( uint8_t *src_y, uint8_t *src_u, uint8_t *src_v, const int w, const in
const int uv_width = w / 2; const int uv_width = w / 2;
const int uv_height = h / 2; const int uv_height = h / 2;
uchar * const rgb = new uchar[(w * h * 4)]; //qt needs a 32bit align uchar * const rgb = new uchar[(w * h * 4)]; //tqt needs a 32bit align
if( !rgb ) if( !rgb )
return 0; return 0;

@ -122,8 +122,8 @@ MainWindow::MainWindow()
#define make_menu( name, text ) \ #define make_menu( name, text ) \
menu = new TQPopupMenu( this, name ); \ menu = new TQPopupMenu( this, name ); \
menu->setCheckable( true ); \ menu->setCheckable( true ); \
connect( menu, SIGNAL(activated( int )), engine(), SLOT(setStreamParameter( int )) ); \ connect( menu, TQ_SIGNAL(activated( int )), engine(), TQ_SLOT(setStreamParameter( int )) ); \
connect( menu, SIGNAL(aboutToShow()), SLOT(aboutToShowMenu()) ); \ connect( menu, TQ_SIGNAL(aboutToShow()), TQ_SLOT(aboutToShowMenu()) ); \
settings->insertItem( text, menu, id, index ); \ settings->insertItem( text, menu, id, index ); \
settings->setItemEnabled( id, false ); \ settings->setItemEnabled( id, false ); \
id++, index++; id++, index++;
@ -159,7 +159,7 @@ MainWindow::MainWindow()
else { else {
//"faster" startup //"faster" startup
//TODO if we have a size stored for this video, do the "faster" route //TODO if we have a size stored for this video, do the "faster" route
TQTimer::singleShot( 0, this, SLOT(init()) ); TQTimer::singleShot( 0, this, TQ_SLOT(init()) );
TQApplication::setOverrideCursor( KCursor::waitCursor() ); } TQApplication::setOverrideCursor( KCursor::waitCursor() ); }
} }
@ -168,11 +168,11 @@ MainWindow::init()
{ {
DEBUG_BLOCK DEBUG_BLOCK
connect( engine(), SIGNAL(statusMessage( const TQString& )), this, SLOT(engineMessage( const TQString& )) ); connect( engine(), TQ_SIGNAL(statusMessage( const TQString& )), this, TQ_SLOT(engineMessage( const TQString& )) );
connect( engine(), SIGNAL(stateChanged( Engine::State )), this, SLOT(engineStateChanged( Engine::State )) ); connect( engine(), TQ_SIGNAL(stateChanged( Engine::State )), this, TQ_SLOT(engineStateChanged( Engine::State )) );
connect( engine(), SIGNAL(channelsChanged( const TQStringList& )), this, SLOT(setChannels( const TQStringList& )) ); connect( engine(), TQ_SIGNAL(channelsChanged( const TQStringList& )), this, TQ_SLOT(setChannels( const TQStringList& )) );
connect( engine(), SIGNAL(titleChanged( const TQString& )), m_titleLabel, SLOT(setText( const TQString& )) ); connect( engine(), TQ_SIGNAL(titleChanged( const TQString& )), m_titleLabel, TQ_SLOT(setText( const TQString& )) );
connect( m_positionSlider, SIGNAL(valueChanged( int )), this, SLOT(showTime( int )) ); connect( m_positionSlider, TQ_SIGNAL(valueChanged( int )), this, TQ_SLOT(showTime( int )) );
if( !engine()->init() ) { if( !engine()->init() ) {
KMessageBox::error( this, i18n( KMessageBox::error( this, i18n(
@ -183,8 +183,8 @@ MainWindow::init()
//would be dangerous for these to65535 happen before the videoWindow() is initialised //would be dangerous for these to65535 happen before the videoWindow() is initialised
setAcceptDrops( true ); setAcceptDrops( true );
connect( m_positionSlider, SIGNAL(sliderReleased( uint )), engine(), SLOT(seek( uint )) ); connect( m_positionSlider, TQ_SIGNAL(sliderReleased( uint )), engine(), TQ_SLOT(seek( uint )) );
connect( statusBar(), SIGNAL(messageChanged( const TQString& )), engine(), SLOT(showOSD( const TQString& )) ); connect( statusBar(), TQ_SIGNAL(messageChanged( const TQString& )), engine(), TQ_SLOT(showOSD( const TQString& )) );
TQApplication::restoreOverrideCursor(); TQApplication::restoreOverrideCursor();
@ -246,26 +246,26 @@ MainWindow::setupActions()
TDEActionCollection * const ac = actionCollection(); TDEActionCollection * const ac = actionCollection();
KStdAction::quit( kapp, SLOT(quit()), ac ); KStdAction::quit( kapp, TQ_SLOT(quit()), ac );
KStdAction::open( this, SLOT(playMedia()), ac, "play_media" )->setText( i18n("Play &Media...") ); KStdAction::open( this, TQ_SLOT(playMedia()), ac, "play_media" )->setText( i18n("Play &Media...") );
connect( new FullScreenAction( this, ac ), SIGNAL(toggled( bool )), SLOT(fullScreenToggled( bool )) ); connect( new FullScreenAction( this, ac ), TQ_SIGNAL(toggled( bool )), TQ_SLOT(fullScreenToggled( bool )) );
new PlayAction( this, SLOT(play()), ac ); new PlayAction( this, TQ_SLOT(play()), ac );
new TDEAction( i18n("Stop"), "media-playback-stop", Key_S, engine(), SLOT(stop()), ac, "stop" ); new TDEAction( i18n("Stop"), "media-playback-stop", Key_S, engine(), TQ_SLOT(stop()), ac, "stop" );
new TDEToggleAction( i18n("Record"), "player_record", CTRL + Key_R, engine(), SLOT(record()), ac, "record" ); new TDEToggleAction( i18n("Record"), "player_record", CTRL + Key_R, engine(), TQ_SLOT(record()), ac, "record" );
new TDEAction( i18n("Reset Video Scale"), "viewmag1", Key_Equal, videoWindow(), SLOT(resetZoom()), ac, "reset_zoom" ); new TDEAction( i18n("Reset Video Scale"), "viewmag1", Key_Equal, videoWindow(), TQ_SLOT(resetZoom()), ac, "reset_zoom" );
new TDEAction( i18n("Media Information"), "messagebox_info", Key_I, this, SLOT(streamInformation()), ac, "information" ); new TDEAction( i18n("Media Information"), "messagebox_info", Key_I, this, TQ_SLOT(streamInformation()), ac, "information" );
new TDEAction( i18n("Menu Toggle"), "media-optical-dvd-unmounted", Key_R, engine(), SLOT(toggleDVDMenu()), ac, "media-optical-dvd-unmounted" ); new TDEAction( i18n("Menu Toggle"), "media-optical-dvd-unmounted", Key_R, engine(), TQ_SLOT(toggleDVDMenu()), ac, "media-optical-dvd-unmounted" );
new TDEAction( i18n("&Capture Frame"), "frame_image", Key_C, this, SLOT(captureFrame()), ac, "capture_frame" ); new TDEAction( i18n("&Capture Frame"), "frame_image", Key_C, this, TQ_SLOT(captureFrame()), ac, "capture_frame" );
new TDEAction( i18n("Video Settings..."), "configure", Key_V, this, SLOT(configure()), ac, "video_settings" ); new TDEAction( i18n("Video Settings..."), "configure", Key_V, this, TQ_SLOT(configure()), ac, "video_settings" );
new TDEAction( i18n("Configure xine..."), "configure", 0, this, SLOT(configure()), ac, "xine_settings" ); new TDEAction( i18n("Configure xine..."), "configure", 0, this, TQ_SLOT(configure()), ac, "xine_settings" );
(new KWidgetAction( m_positionSlider, i18n("Position Slider"), 0, 0, 0, ac, "position_slider" ))->setAutoSized( true ); (new KWidgetAction( m_positionSlider, i18n("Position Slider"), 0, 0, 0, ac, "position_slider" ))->setAutoSized( true );
new VolumeAction( toolBar(), ac ); m_volumeAction = new VolumeAction( toolBar(), ac );
} }
void void

@ -11,13 +11,14 @@ class KURL;
class TQLabel; class TQLabel;
class TQPopupMenu; class TQPopupMenu;
class TQSlider; class TQSlider;
class VolumeAction;
namespace Codeine namespace Codeine
{ {
class MainWindow : public TDEMainWindow class MainWindow : public TDEMainWindow
{ {
Q_OBJECT TQ_OBJECT
MainWindow(); MainWindow();
~MainWindow(); ~MainWindow();
@ -65,6 +66,7 @@ namespace Codeine
TQLabel *m_timeLabel; TQLabel *m_timeLabel;
TQLabel *m_titleLabel; TQLabel *m_titleLabel;
TQWidget *m_analyzer; TQWidget *m_analyzer;
VolumeAction *m_volumeAction;
//undefined //undefined
MainWindow( const MainWindow& ); MainWindow( const MainWindow& );

@ -37,19 +37,19 @@ PlayDialog::PlayDialog( TQWidget *parent, bool be_welcome_dialog )
//TODO use the kguiItems from the actions //TODO use the kguiItems from the actions
mapper->setMapping( o = new KPushButton( KGuiItem( i18n("Play File..."), "folder" ), this ), FILE ); mapper->setMapping( o = new KPushButton( KGuiItem( i18n("Play File..."), "folder" ), this ), FILE );
connect( o, SIGNAL(clicked()), mapper, SLOT(map()) ); connect( o, TQ_SIGNAL(clicked()), mapper, TQ_SLOT(map()) );
grid->TQLayout::add( o ); grid->TQLayout::add( o );
mapper->setMapping( o = new KPushButton( KGuiItem( i18n("Play VCD"), "media-optical-cdaudio-unmounted" ), this ), VCD ); mapper->setMapping( o = new KPushButton( KGuiItem( i18n("Play VCD"), "media-optical-cdaudio-unmounted" ), this ), VCD );
connect( o, SIGNAL(clicked()), mapper, SLOT(map()) ); connect( o, TQ_SIGNAL(clicked()), mapper, TQ_SLOT(map()) );
grid->TQLayout::add( o ); grid->TQLayout::add( o );
mapper->setMapping( o = new KPushButton( KGuiItem( i18n("Play DVD"), "media-optical-dvd-unmounted" ), this ), DVD ); mapper->setMapping( o = new KPushButton( KGuiItem( i18n("Play DVD"), "media-optical-dvd-unmounted" ), this ), DVD );
connect( o, SIGNAL(clicked()), mapper, SLOT(map()) ); connect( o, TQ_SIGNAL(clicked()), mapper, TQ_SLOT(map()) );
grid->TQLayout::add( o ); grid->TQLayout::add( o );
mapper->setMapping( closeButton, TQDialog::Rejected ); mapper->setMapping( closeButton, TQDialog::Rejected );
connect( closeButton, SIGNAL(clicked()), mapper, SLOT(map()) ); connect( closeButton, TQ_SIGNAL(clicked()), mapper, TQ_SLOT(map()) );
createRecentFileWidget( vbox ); createRecentFileWidget( vbox );
@ -59,12 +59,12 @@ PlayDialog::PlayDialog( TQWidget *parent, bool be_welcome_dialog )
if( be_welcome_dialog ) { if( be_welcome_dialog ) {
TQWidget *w = new KPushButton( KStdGuiItem::quit(), this ); TQWidget *w = new KPushButton( KStdGuiItem::quit(), this );
hbox->addWidget( w ); hbox->addWidget( w );
connect( w, SIGNAL(clicked()), kapp, SLOT(quit()) ); connect( w, TQ_SIGNAL(clicked()), kapp, TQ_SLOT(quit()) );
} }
hbox->addWidget( closeButton ); hbox->addWidget( closeButton );
connect( mapper, SIGNAL(mapped( int )), SLOT(done( int )) ); connect( mapper, TQ_SIGNAL(mapped( int )), TQ_SLOT(done( int )) );
} }
void void
@ -98,7 +98,7 @@ PlayDialog::createRecentFileWidget( TQBoxLayout *layout )
if( lv->childCount() ) { if( lv->childCount() ) {
layout->addWidget( lv, 1 ); layout->addWidget( lv, 1 );
connect( lv, SIGNAL(executed( TQListViewItem* )), SLOT(done( TQListViewItem* )) ); connect( lv, TQ_SIGNAL(executed( TQListViewItem* )), TQ_SLOT(done( TQListViewItem* )) );
} }
else else
delete lv; delete lv;

@ -15,7 +15,7 @@ namespace Codeine
{ {
class PlayDialog : public TQDialog class PlayDialog : public TQDialog
{ {
Q_OBJECT TQ_OBJECT
public: public:
PlayDialog( TQWidget*, bool show_welcome_dialog = false ); PlayDialog( TQWidget*, bool show_welcome_dialog = false );

@ -10,7 +10,7 @@ namespace Codeine
{ {
class Slider : public TQSlider class Slider : public TQSlider
{ {
Q_OBJECT TQ_OBJECT
public: public:
static Slider *instance() { return s_instance; } static Slider *instance() { return s_instance; }

@ -16,6 +16,7 @@
#include "theStream.h" #include "theStream.h"
#include "videoSettings.h" //FIXME unfortunate #include "videoSettings.h" //FIXME unfortunate
#include "xineEngine.h" #include "xineEngine.h"
#include "volumeAction.h"
//TODO do in Sconstruct //TODO do in Sconstruct
@ -62,9 +63,7 @@ MainWindow::engineStateChanged( Engine::State state )
toggleAction( "play" )->setChecked( state == Playing ); toggleAction( "play" )->setChecked( state == Playing );
//FIXME bad design to do this way //FIXME bad design to do this way
TQSlider *volume = (TQSlider*)toolBar()->child( "volume" ); m_volumeAction->sliderMoved( engine()->volume() );
if (volume)
volume->setValue( engine()->volume() );
} }

@ -37,7 +37,7 @@ public:
setTickmarks( TQSlider::Below ); setTickmarks( TQSlider::Below );
setTickInterval( 65536 / 4 ); setTickInterval( 65536 / 4 );
setMinimumWidth( fontMetrics().width( name ) * 3 ); setMinimumWidth( fontMetrics().width( name ) * 3 );
connect( this, SIGNAL(valueChanged( int )), Codeine::engine(), SLOT(setStreamParameter( int )) ); connect( this, TQ_SIGNAL(valueChanged( int )), Codeine::engine(), TQ_SLOT(setStreamParameter( int )) );
} }
virtual void mousePressEvent( TQMouseEvent *e ) virtual void mousePressEvent( TQMouseEvent *e )

@ -54,7 +54,7 @@ VideoWindow::initVideo()
m_displayRatio = w / h; m_displayRatio = w / h;
} }
connect( &m_timer, SIGNAL(timeout()), SLOT(hideCursor()) ); connect( &m_timer, TQ_SIGNAL(timeout()), TQ_SLOT(hideCursor()) );
XUnlockDisplay( X::d ); XUnlockDisplay( X::d );
} }

@ -31,13 +31,19 @@ public:
slider->setRange( 0, 100 ); slider->setRange( 0, 100 );
setFrameStyle( TQFrame::Plain | TQFrame::Box ); setFrameStyle( TQFrame::Plain | TQFrame::Box );
setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed ); setSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Preferred );
// Calculate width required for max label size
label->setText( "100%" );
adjustSize();
requiredWidth = width();
hide(); hide();
} }
TQLabel *label; TQLabel *label;
TQSlider *slider; TQSlider *slider;
int requiredWidth;
}; };
@ -47,10 +53,10 @@ VolumeAction::VolumeAction( TDEToolBar *bar, TDEActionCollection *ac )
{ {
m_widget = new VolumeSlider( bar->topLevelWidget() ); m_widget = new VolumeSlider( bar->topLevelWidget() );
connect( this, SIGNAL(toggled( bool )), SLOT(toggled( bool )) ); connect( this, TQ_SIGNAL(toggled( bool )), TQ_SLOT(toggled( bool )) );
connect( m_widget->slider, SIGNAL(sliderMoved( int )), SLOT(sliderMoved( int )) ); connect( m_widget->slider, TQ_SIGNAL(sliderMoved( int )), TQ_SLOT(sliderMoved( int )) );
connect( m_widget->slider, SIGNAL(sliderMoved( int )), Codeine::engine(), SLOT(setStreamParameter( int )) ); connect( m_widget->slider, TQ_SIGNAL(sliderMoved( int )), Codeine::engine(), TQ_SLOT(setStreamParameter( int )) );
connect( m_widget->slider, SIGNAL(sliderReleased()), SLOT(sliderReleased()) ); connect( m_widget->slider, TQ_SIGNAL(sliderReleased()), TQ_SLOT(sliderReleased()) );
} }
int int
@ -71,6 +77,10 @@ VolumeAction::toggled( bool const b )
{ {
DEBUG_BLOCK DEBUG_BLOCK
TQString t = TQString::number(100 - m_widget->slider->value()) + "%";
setToolTip( i18n( "Volume: %1" ).arg( t ) );
m_widget->label->setText( t );
m_widget->raise(); m_widget->raise();
m_widget->setShown( b ); m_widget->setShown( b );
} }
@ -80,7 +90,7 @@ VolumeAction::sliderMoved( int v )
{ {
v = 100 - v; //TQt sliders are wrong way round when vertical v = 100 - v; //TQt sliders are wrong way round when vertical
TQString const t = TQString::number( v ) + '%'; TQString t = TQString::number( v ) + '%';
setToolTip( i18n( "Volume: %1" ).arg( t ) ); setToolTip( i18n( "Volume: %1" ).arg( t ) );
m_widget->label->setText( t ); m_widget->label->setText( t );
@ -94,8 +104,8 @@ VolumeAction::eventFilter( TQObject *o, TQEvent *e )
case TQEvent::Resize: { case TQEvent::Resize: {
TQWidget const * const &a = m_anchor; TQWidget const * const &a = m_anchor;
m_widget->move( a->mapTo( m_widget->parentWidget(), TQPoint( 0, a->height() ) ) ); m_widget->resize( m_widget->requiredWidth, m_widget->sizeHint().height() );
m_widget->resize( a->width(), m_widget->sizeHint().height() ); m_widget->move( a->mapTo( m_widget->parentWidget(), TQPoint( a->width() - m_widget->width(), a->height() ) ) );
return false; return false;
} }

@ -8,7 +8,7 @@
class VolumeAction : public TDEToggleAction class VolumeAction : public TDEToggleAction
{ {
Q_OBJECT TQ_OBJECT
TQWidget *m_anchor; TQWidget *m_anchor;
class VolumeSlider *m_widget; class VolumeSlider *m_widget;
@ -17,9 +17,11 @@ class VolumeAction : public TDEToggleAction
virtual int plug( TQWidget*, int ); virtual int plug( TQWidget*, int );
public slots:
void sliderMoved( int );
private slots: private slots:
void toggled( bool ); void toggled( bool );
void sliderMoved( int );
void sliderReleased() { setChecked( false ); toggled( false ); } void sliderReleased() { setChecked( false ); toggled( false ); }
public: public:

@ -218,7 +218,7 @@ XineConfigEntry::XineConfigEntry( TQWidget *parent, TQGridLayout *grid, xine_cfg
{ {
case XINE_CONFIG_TYPE_STRING: { case XINE_CONFIG_TYPE_STRING: {
w = new KLineEdit( m_string, parent ); w = new KLineEdit( m_string, parent );
signal = SIGNAL(textChanged( const TQString& )); signal = TQ_SIGNAL(textChanged( const TQString& ));
break; break;
} }
case XINE_CONFIG_TYPE_ENUM: { case XINE_CONFIG_TYPE_ENUM: {
@ -226,7 +226,7 @@ XineConfigEntry::XineConfigEntry( TQWidget *parent, TQGridLayout *grid, xine_cfg
for( int i = 0; entry->enum_values[i]; ++i ) for( int i = 0; entry->enum_values[i]; ++i )
((KComboBox*)w)->insertItem( TQString::fromUtf8( entry->enum_values[i] ) ); ((KComboBox*)w)->insertItem( TQString::fromUtf8( entry->enum_values[i] ) );
((KComboBox*)w)->setCurrentItem( m_number ); ((KComboBox*)w)->setCurrentItem( m_number );
signal = SIGNAL(activated( int )); signal = TQ_SIGNAL(activated( int ));
break; break;
} }
case XINE_CONFIG_TYPE_RANGE: case XINE_CONFIG_TYPE_RANGE:
@ -236,14 +236,14 @@ XineConfigEntry::XineConfigEntry( TQWidget *parent, TQGridLayout *grid, xine_cfg
TQMAX( m_number, entry->range_max ), // are both 0 even though this is bullshit TQMAX( m_number, entry->range_max ), // are both 0 even though this is bullshit
1, parent ); 1, parent );
((TQSpinBox*)w)->setValue( m_number ); ((TQSpinBox*)w)->setValue( m_number );
signal = SIGNAL(valueChanged( int )); signal = TQ_SIGNAL(valueChanged( int ));
break; break;
} }
case XINE_CONFIG_TYPE_BOOL: { case XINE_CONFIG_TYPE_BOOL: {
w = new TQCheckBox( description_text, parent ); w = new TQCheckBox( description_text, parent );
((TQCheckBox*)w)->setChecked( m_number ); ((TQCheckBox*)w)->setChecked( m_number );
connect( w, SIGNAL(toggled( bool )), XineConfigDialog::instance(), SLOT(slotHelp()) ); connect( w, TQ_SIGNAL(toggled( bool )), XineConfigDialog::instance(), TQ_SLOT(slotHelp()) );
TQToolTip::add( w, "<qt>" + TQString::fromUtf8( entry->help ) ); TQToolTip::add( w, "<qt>" + TQString::fromUtf8( entry->help ) );
grid->addMultiCellWidget( w, row, row, 0, 1 ); grid->addMultiCellWidget( w, row, row, 0, 1 );
return; //no need for a description label return; //no need for a description label
@ -252,7 +252,7 @@ XineConfigEntry::XineConfigEntry( TQWidget *parent, TQGridLayout *grid, xine_cfg
; ;
} }
connect( w, signal, XineConfigDialog::instance(), SLOT(slotHelp()) ); connect( w, signal, XineConfigDialog::instance(), TQ_SLOT(slotHelp()) );
TQLabel *description = new TQLabel( description_text + ':', parent ); TQLabel *description = new TQLabel( description_text + ':', parent );
description->setAlignment( TQLabel::WordBreak | TQLabel::AlignVCenter ); description->setAlignment( TQLabel::WordBreak | TQLabel::AlignVCenter );

@ -26,6 +26,7 @@ namespace Codeine {
VideoWindow *VideoWindow::s_instance = 0; VideoWindow *VideoWindow::s_instance = 0;
bool VideoWindow::s_logarithmicVolume = false;
VideoWindow::VideoWindow( TQWidget *parent ) VideoWindow::VideoWindow( TQWidget *parent )
@ -53,6 +54,13 @@ VideoWindow::VideoWindow( TQWidget *parent )
//TODO sucks //TODO sucks
//TODO namespace this? //TODO namespace this?
myList->next = myList; //init the buffer list myList->next = myList; //init the buffer list
// Detect xine version, this is used for volume adjustment.
// Xine versions prior to 1.2.13 use linear volume, so the engine uses logarithmic volume.
// Xine versions starting from 1.2.13 use logarithmic volume, so the engine uses linear volume.
int xinemajor = 0, xineminor = 0, xinemaint = 0;
xine_get_version(&xinemajor, &xineminor, &xinemaint);
s_logarithmicVolume = (xinemajor * 1000000 + xineminor * 1000 + xinemaint < 1002013);
} }
VideoWindow::~VideoWindow() VideoWindow::~VideoWindow()
@ -65,7 +73,12 @@ VideoWindow::~VideoWindow()
if( m_stream && xine_get_status( m_stream ) == XINE_STATUS_PLAY ) { if( m_stream && xine_get_status( m_stream ) == XINE_STATUS_PLAY ) {
int cum = 0; int cum = 0;
for( int v = 99; v >= 0; v-- ) { for( int v = 99; v >= 0; v-- ) {
xine_set_param( m_stream, XINE_PARAM_AUDIO_AMP_LEVEL, v ); int vol = v;
if (s_logarithmicVolume)
{
vol = makeVolumeLogarithmic(vol);
}
xine_set_param( m_stream, XINE_PARAM_AUDIO_AMP_LEVEL, vol );
int sleep = int(32000 * (-std::log10( double(v + 1) ) + 2)); int sleep = int(32000 * (-std::log10( double(v + 1) ) + 2));
::usleep( sleep ); ::usleep( sleep );
@ -255,6 +268,7 @@ VideoWindow::load( const KURL &url )
setParameter( XINE_PARAM_SPU_CHANNEL, -1 ); setParameter( XINE_PARAM_SPU_CHANNEL, -1 );
setParameter( XINE_PARAM_AUDIO_CHANNEL_LOGICAL, -1 ); setParameter( XINE_PARAM_AUDIO_CHANNEL_LOGICAL, -1 );
setParameter( XINE_PARAM_VO_ASPECT_RATIO, 0 ); setParameter( XINE_PARAM_VO_ASPECT_RATIO, 0 );
// 100 is the same for both linear and logarithmic volume control
setParameter( XINE_PARAM_AUDIO_AMP_LEVEL, 100 ); setParameter( XINE_PARAM_AUDIO_AMP_LEVEL, 100 );
#undef setParameter #undef setParameter
@ -445,8 +459,20 @@ VideoWindow::posTimeLength( PosTimeLength type ) const
uint uint
VideoWindow::volume() const VideoWindow::volume() const
{ {
//TODO I don't like the design int vol = xine_get_param( m_stream, XINE_PARAM_AUDIO_AMP_LEVEL );
return xine_get_param( m_stream, XINE_PARAM_AUDIO_AMP_LEVEL ); if (s_logarithmicVolume)
{
vol = 100 - 100.0 * (pow(10, (100.0 - vol) / 100.0) - 1) / 9.0;
}
if (vol < 0)
{
vol = 0;
}
if (vol > 100)
{
vol = 100;
}
return (uint)vol;
} }
void void
@ -532,6 +558,13 @@ VideoWindow::seek( uint pos )
xine_set_param( m_stream, XINE_PARAM_AUDIO_AMP_MUTE, 0 ); xine_set_param( m_stream, XINE_PARAM_AUDIO_AMP_MUTE, 0 );
} }
int
VideoWindow::makeVolumeLogarithmic(int volume)
{
// We're using a logarithmic function to make the volume ramp more natural.
return static_cast<uint>( 100 - 100.0 * std::log10( ( 100 - volume ) * 0.09 + 1.0 ) );
}
void void
VideoWindow::setStreamParameter( int value ) VideoWindow::setStreamParameter( int value )
{ {
@ -555,7 +588,14 @@ VideoWindow::setStreamParameter( int value )
else if( sender == "aspect_ratio_menu" ) else if( sender == "aspect_ratio_menu" )
parameter = XINE_PARAM_VO_ASPECT_RATIO; parameter = XINE_PARAM_VO_ASPECT_RATIO;
else if( sender == "volume" ) else if( sender == "volume" )
{
parameter = XINE_PARAM_AUDIO_AMP_LEVEL; parameter = XINE_PARAM_AUDIO_AMP_LEVEL;
value = 100 - value; // TQt sliders are wrong way round when vertical
if (s_logarithmicVolume)
{
value = makeVolumeLogarithmic(value);
}
}
else else
return; return;
@ -722,7 +762,7 @@ VideoWindow::xineEventListener( void *p, const xine_event_t* xineEvent )
//FIXME this is not the right way, it will have bugs //FIXME this is not the right way, it will have bugs
debug() << "XINE_EVENT_MRL_REFERENCE\n"; debug() << "XINE_EVENT_MRL_REFERENCE\n";
engine->m_url = TQString::fromUtf8( ((xine_mrl_reference_data_ext_t*)xineEvent->data)->mrl ); engine->m_url = TQString::fromUtf8( ((xine_mrl_reference_data_ext_t*)xineEvent->data)->mrl );
TQTimer::singleShot( 0, engine, SLOT(play()) ); TQTimer::singleShot( 0, engine, TQ_SLOT(play()) );
break; break;
} }
case XINE_EVENT_DROPPED_FRAMES: debug() << "XINE_EVENT_DROPPED_FRAMES\n"; break; case XINE_EVENT_DROPPED_FRAMES: debug() << "XINE_EVENT_DROPPED_FRAMES\n"; break;

@ -34,11 +34,12 @@ namespace Codeine
*/ */
class VideoWindow : public TQWidget class VideoWindow : public TQWidget
{ {
Q_OBJECT TQ_OBJECT
enum PosTimeLength { Pos, Time, Length }; enum PosTimeLength { Pos, Time, Length };
static VideoWindow *s_instance; static VideoWindow *s_instance;
static bool s_logarithmicVolume;
VideoWindow( const VideoWindow& ); //disable VideoWindow( const VideoWindow& ); //disable
VideoWindow &operator=( const VideoWindow& ); //disable VideoWindow &operator=( const VideoWindow& ); //disable
@ -120,6 +121,7 @@ namespace Codeine
private: private:
static void destSizeCallBack( void*, int, int, double, int*, int*, double* ); static void destSizeCallBack( void*, int, int, double, int*, int*, double* );
static void frameOutputCallBack( void*, int, int, double, int*, int*, int*, int*, double*, int*, int* ); static void frameOutputCallBack( void*, int, int, double, int*, int*, int*, int*, double*, int*, int* );
static int makeVolumeLogarithmic(int volume);
void initVideo(); void initVideo();
void cleanUpVideo(); void cleanUpVideo();

@ -35,8 +35,8 @@ namespace Codeine
//FIXME this will terminate the host, eg Konqueror //FIXME this will terminate the host, eg Konqueror
Debug::fatal() << "Couldn't init xine!\n"; Debug::fatal() << "Couldn't init xine!\n";
TDEAction *play = new TDEToggleAction( i18n("Play"), "media-playback-start", TQt::Key_Space, videoWindow(), SLOT(togglePlay()), actionCollection(), "play" ); TDEAction *play = new TDEToggleAction( i18n("Play"), "media-playback-start", TQt::Key_Space, videoWindow(), TQ_SLOT(togglePlay()), actionCollection(), "play" );
TDEAction *mute = new TDEToggleAction( i18n("Mute"), "player_mute", TQt::Key_M, videoWindow(), SLOT(toggleMute()), actionCollection(), "mute" ); TDEAction *mute = new TDEToggleAction( i18n("Mute"), "player_mute", TQt::Key_M, videoWindow(), TQ_SLOT(toggleMute()), actionCollection(), "mute" );
TDEToolBar *toolBar = new MouseOverToolBar( widget() ); TDEToolBar *toolBar = new MouseOverToolBar( widget() );
play->plug( toolBar ); play->plug( toolBar );
mute->plug( toolBar ); mute->plug( toolBar );
@ -46,8 +46,8 @@ namespace Codeine
toolBar->addSeparator(); //FIXME ugly toolBar->addSeparator(); //FIXME ugly
TQObject *o = (TQObject*)statusBar(); TQObject *o = (TQObject*)statusBar();
connect( videoWindow(), SIGNAL(statusMessage( const TQString& )), o, SLOT(message( const TQString& )) ); connect( videoWindow(), TQ_SIGNAL(statusMessage( const TQString& )), o, TQ_SLOT(message( const TQString& )) );
connect( videoWindow(), SIGNAL(titleChanged( const TQString& )), o, SLOT(message( const TQString& )) ); //FIXME connect( videoWindow(), TQ_SIGNAL(titleChanged( const TQString& )), o, TQ_SLOT(message( const TQString& )) ); //FIXME
} }
bool bool

@ -71,7 +71,7 @@ VideoWindow::VideoWindow( TQWidget *parent, const char *name )
XUnlockDisplay( X::d ); XUnlockDisplay( X::d );
connect( &m_timer, SIGNAL(timeout()), SLOT(hideCursor()) ); connect( &m_timer, TQ_SIGNAL(timeout()), TQ_SLOT(hideCursor()) );
} }
VideoWindow::~VideoWindow() VideoWindow::~VideoWindow()

@ -24,7 +24,7 @@ namespace Codeine
{ {
class VideoWindow : public TQWidget class VideoWindow : public TQWidget
{ {
Q_OBJECT TQ_OBJECT
static VideoWindow *s_instance; static VideoWindow *s_instance;
static const uint CURSOR_HIDE_TIMEOUT = 2000; static const uint CURSOR_HIDE_TIMEOUT = 2000;

@ -30,7 +30,8 @@ msgstr "Reproductor multimedia"
#. Comment #. Comment
#: codeine.desktop:7 #: codeine.desktop:7
msgid "Video player for TDE designed to be as simple as possible" msgid "Video player for TDE designed to be as simple as possible"
msgstr "Reproductor de vídeo para TDE diseñado para ser lo más sencillo posible" msgstr ""
"Reproductor de vídeo para TDE diseñado para ser lo más sencillo posible"
#. Comment #. Comment
#: codeine_part.desktop:5 #: codeine_part.desktop:5

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2020-07-26 20:37+0200\n" "POT-Creation-Date: 2023-10-09 20:16+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -251,19 +251,19 @@ msgstr ""
msgid "Codeine could not open the file: %1" msgid "Codeine could not open the file: %1"
msgstr "" msgstr ""
#: app/stateChange.cpp:90 #: app/stateChange.cpp:89
msgid "&Pause" msgid "&Pause"
msgstr "" msgstr ""
#: app/stateChange.cpp:90 #: app/stateChange.cpp:89
msgid "&Play" msgid "&Play"
msgstr "" msgstr ""
#: app/stateChange.cpp:154 #: app/stateChange.cpp:153
msgid "No media loaded" msgid "No media loaded"
msgstr "" msgstr ""
#: app/stateChange.cpp:157 #: app/stateChange.cpp:156
msgid "Paused" msgid "Paused"
msgstr "" msgstr ""
@ -347,11 +347,11 @@ msgstr ""
msgid "Pause" msgid "Pause"
msgstr "" msgstr ""
#: app/volumeAction.cpp:45 #: app/volumeAction.cpp:51
msgid "Volume" msgid "Volume"
msgstr "" msgstr ""
#: app/volumeAction.cpp:85 #: app/volumeAction.cpp:81 app/volumeAction.cpp:95
#, c-format #, c-format
msgid "Volume: %1" msgid "Volume: %1"
msgstr "" msgstr ""
@ -366,102 +366,102 @@ msgid ""
"However, full configurability is provided for your pleasure ;-)." "However, full configurability is provided for your pleasure ;-)."
msgstr "" msgstr ""
#: app/xineEngine.cpp:137 part/xineEngine.cpp:50 #: app/xineEngine.cpp:150 part/xineEngine.cpp:50
msgid "xine was unable to initialize any video-drivers." msgid "xine was unable to initialize any video-drivers."
msgstr "" msgstr ""
#: app/xineEngine.cpp:139 part/xineEngine.cpp:48 #: app/xineEngine.cpp:152 part/xineEngine.cpp:48
msgid "xine was unable to initialize any audio-drivers." msgid "xine was unable to initialize any audio-drivers."
msgstr "" msgstr ""
#: app/xineEngine.cpp:244 #: app/xineEngine.cpp:257
#, c-format #, c-format
msgid "Loading media: %1" msgid "Loading media: %1"
msgstr "" msgstr ""
#: app/xineEngine.cpp:349 #: app/xineEngine.cpp:363
#, c-format #, c-format
msgid "Recording to: %1" msgid "Recording to: %1"
msgstr "" msgstr ""
#: app/xineEngine.cpp:380 #: app/xineEngine.cpp:394
msgid "Playback paused" msgid "Playback paused"
msgstr "" msgstr ""
#: app/xineEngine.cpp:385 #: app/xineEngine.cpp:399
msgid "Playback resumed" msgid "Playback resumed"
msgstr "" msgstr ""
#: app/xineEngine.cpp:398 #: app/xineEngine.cpp:412
#, c-format #, c-format
msgid "There is no input plugin that can read: %1." msgid "There is no input plugin that can read: %1."
msgstr "" msgstr ""
#: app/xineEngine.cpp:401 #: app/xineEngine.cpp:415
#, c-format #, c-format
msgid "There is no demux plugin available for %1." msgid "There is no demux plugin available for %1."
msgstr "" msgstr ""
#: app/xineEngine.cpp:404 #: app/xineEngine.cpp:418
#, c-format #, c-format
msgid "Demuxing failed for %1." msgid "Demuxing failed for %1."
msgstr "" msgstr ""
#: app/xineEngine.cpp:409 #: app/xineEngine.cpp:423
#, c-format #, c-format
msgid "Internal error while attempting to play %1." msgid "Internal error while attempting to play %1."
msgstr "" msgstr ""
#: app/xineEngine.cpp:497 #: app/xineEngine.cpp:523
msgid "xine cannot currently seek in flac media" msgid "xine cannot currently seek in flac media"
msgstr "" msgstr ""
#: app/xineEngine.cpp:675 app/xineEngine.cpp:683 #: app/xineEngine.cpp:715 app/xineEngine.cpp:723
#, c-format #, c-format
msgid "Channel %1" msgid "Channel %1"
msgstr "" msgstr ""
#: app/xineEngine.cpp:782 part/xineEngine.cpp:289 #: app/xineEngine.cpp:822 part/xineEngine.cpp:289
msgid "The source is encrypted and can not be decrypted." msgid "The source is encrypted and can not be decrypted."
msgstr "" msgstr ""
#: app/xineEngine.cpp:784 part/xineEngine.cpp:291 #: app/xineEngine.cpp:824 part/xineEngine.cpp:291
msgid "The host is unknown for the URL: <i>%1</i>" msgid "The host is unknown for the URL: <i>%1</i>"
msgstr "" msgstr ""
#: app/xineEngine.cpp:786 part/xineEngine.cpp:293 #: app/xineEngine.cpp:826 part/xineEngine.cpp:293
msgid "The device name you specified seems invalid." msgid "The device name you specified seems invalid."
msgstr "" msgstr ""
#: app/xineEngine.cpp:788 part/xineEngine.cpp:295 #: app/xineEngine.cpp:828 part/xineEngine.cpp:295
msgid "The network appears unreachable." msgid "The network appears unreachable."
msgstr "" msgstr ""
#: app/xineEngine.cpp:790 part/xineEngine.cpp:297 #: app/xineEngine.cpp:830 part/xineEngine.cpp:297
msgid "Audio output unavailable; the device is busy." msgid "Audio output unavailable; the device is busy."
msgstr "" msgstr ""
#: app/xineEngine.cpp:792 part/xineEngine.cpp:299 #: app/xineEngine.cpp:832 part/xineEngine.cpp:299
msgid "The connection was refused for the URL: <i>%1</i>" msgid "The connection was refused for the URL: <i>%1</i>"
msgstr "" msgstr ""
#: app/xineEngine.cpp:794 part/xineEngine.cpp:301 #: app/xineEngine.cpp:834 part/xineEngine.cpp:301
msgid "xine could not find the URL: <i>%1</i>" msgid "xine could not find the URL: <i>%1</i>"
msgstr "" msgstr ""
#: app/xineEngine.cpp:796 part/xineEngine.cpp:303 #: app/xineEngine.cpp:836 part/xineEngine.cpp:303
msgid "Access was denied for the URL: <i>%1</i>" msgid "Access was denied for the URL: <i>%1</i>"
msgstr "" msgstr ""
#: app/xineEngine.cpp:798 part/xineEngine.cpp:305 #: app/xineEngine.cpp:838 part/xineEngine.cpp:305
msgid "The source cannot be read for the URL: <i>%1</i>" msgid "The source cannot be read for the URL: <i>%1</i>"
msgstr "" msgstr ""
#: app/xineEngine.cpp:800 part/xineEngine.cpp:307 #: app/xineEngine.cpp:840 part/xineEngine.cpp:307
msgid "A problem occurred while loading a library or decoder." msgid "A problem occurred while loading a library or decoder."
msgstr "" msgstr ""
#: app/xineEngine.cpp:827 part/xineEngine.cpp:334 #: app/xineEngine.cpp:867 part/xineEngine.cpp:334
msgid "Sorry, no additional information is available." msgid "Sorry, no additional information is available."
msgstr "" msgstr ""

Loading…
Cancel
Save