author | zecke <zecke> | 2002-07-10 15:33:36 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-07-10 15:33:36 (UTC) |
commit | 5f0da29ff2f22c017d0aec7b6f1f493120b84f8c (patch) (side-by-side diff) | |
tree | fad58373c81c998bb70cdbc69bb75824e057d4aa | |
parent | e17d551a7c42a1d77805b4f1575928855e0e32ba (diff) | |
download | opie-5f0da29ff2f22c017d0aec7b6f1f493120b84f8c.zip opie-5f0da29ff2f22c017d0aec7b6f1f493120b84f8c.tar.gz opie-5f0da29ff2f22c017d0aec7b6f1f493120b84f8c.tar.bz2 |
First VideoWidget
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 22 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/opieplayer2.pro | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.cpp | 53 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.h | 51 |
5 files changed, 130 insertions, 4 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 441eb6e..ce8604a 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h @@ -1,80 +1,80 @@ #ifndef AUDIO_WIDGET_H #define AUDIO_WIDGET_H #include <qwidget.h> #include <qpainter.h> #include <qdrawutil.h> #include <qpixmap.h> #include <qstring.h> #include <qslider.h> #include <qframe.h> class QPixmap; enum AudioButtons { - AudioPlay, + AudioPlay=0, AudioStop, AudioPause, AudioNext, AudioPrevious, AudioVolumeUp, AudioVolumeDown, AudioLoop, AudioPlayList }; #define USE_DBLBUF class Ticker : public QFrame { Q_OBJECT public: Ticker( QWidget* parent=0 ); ~Ticker(); void setText( const QString& text ) ; protected: void timerEvent( QTimerEvent * ); void drawContents( QPainter *p ); private: QString scrollText; int pos, pixelLen; }; class AudioWidget : public QWidget { Q_OBJECT public: AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 ); ~AudioWidget(); void setTickerText( const QString &text ) { songInfo->setText( text ); } bool isStreaming; public slots: void updateSlider( long, long ); void sliderPressed( ); void sliderReleased( ); void setPaused( bool b) { setToggleButton( AudioPause, b ); } void setLooping( bool b) { setToggleButton( AudioLoop, b ); } void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } void setPosition( long ); void setLength( long ); void setView( char ); signals: void moreClicked(); void lessClicked(); void moreReleased(); void lessReleased(); void sliderMoved(long); protected: void doBlank(); void doUnblank(); void paintEvent( QPaintEvent *pe ); void showEvent( QShowEvent *se ); void mouseMoveEvent( QMouseEvent *event ); void mousePressEvent( QMouseEvent *event ); void mouseReleaseEvent( QMouseEvent *event ); diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c index b8b8eb3..8badb7b 100644 --- a/noncore/multimedia/opieplayer2/nullvideo.c +++ b/noncore/multimedia/opieplayer2/nullvideo.c @@ -1,91 +1,107 @@ /*#include <xine.h>*/ #include <stdlib.h> #include <stdio.h> #include <xine/video_out.h> #include <xine/xine_internal.h> #include <xine/xineutils.h> #include <xine/configfile.h> typedef struct null_driver_s null_driver_t; struct null_driver_s { vo_driver_t vo_driver; uint32_t m_capabilities; int m_show_video; int m_video_fullscreen; int m_is_scaling; }; typedef struct opie_frame_s opie_frame_t; struct opie_frame_s { vo_frame_t frame; char* name; int version; int m_width; int m_height; + int m_ratio_code; + int format; + int flags; + int user_ratio; + + int ideal_width; + int ideal_height; + int output_width, output_height; uint8_t *chunk[3]; + uint8_t *rgb_dst; + int yuv_stride; + int stripe_height, stripe_inc; + + int bytes_per_line; + uint8_t *data; + + null_driver_t *output; }; static uint32_t null_get_capabilities(vo_driver_t *self ){ null_driver_t* this = (null_driver_t*)self; printf("capabilities\n"); return this->m_capabilities; } /* take care of the frame*/ static void null_frame_dispose( vo_frame_t* vo_img){ opie_frame_t* frame = (opie_frame_t*)vo_img; printf("frame_dispose\n"); free (frame); } static void null_frame_field( vo_frame_t* frame, int inti ){ printf("frame_field\n"); /* not needed */ } /* end take care of frames*/ static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ null_driver_t* this = (null_driver_t*)self; opie_frame_t* frame = (opie_frame_t*)malloc ( sizeof(opie_frame_t) ); memset( frame, 0, sizeof( opie_frame_t) ); printf("alloc_frame\n"); frame->name = "opie\0"; frame->version = 1; frame->output = this; /* initialize the frame*/ frame->frame.driver = self; /*frame.frame.free = null_frame_free;*/ frame->frame.copy = NULL; frame->frame.field = null_frame_field; frame->frame.dispose = null_frame_dispose; return (vo_frame_t*) frame; } static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, uint32_t width, uint32_t height, int ratio_code, int format, int flags ){ null_driver_t* this = (null_driver_t*) self; opie_frame_t* frame = (opie_frame_t*)img; /* not needed now */ printf("update_frame_format\n"); printf("al crash aye?\n"); if(frame->chunk[0] ){ free( frame->chunk[0] ); frame->chunk[0] = NULL; } if(frame->chunk[1] ){ free ( frame->chunk[1] ); frame->chunk[1] = NULL; } if(frame->chunk[2] ){ free ( frame->chunk[2] ); frame->chunk[2] = NULL; } @@ -155,64 +171,70 @@ vo_driver_t* init_video_out_plugin( config_values_t* conf, /* memset? */ /* install callback handlers*/ vo->vo_driver.get_capabilities = null_get_capabilities; vo->vo_driver.alloc_frame = null_alloc_frame; vo->vo_driver.update_frame_format = null_update_frame_format; vo->vo_driver.display_frame = null_display_frame; vo->vo_driver.overlay_blend = null_overlay_blend; vo->vo_driver.get_property = null_get_property; vo->vo_driver.set_property = null_set_property; vo->vo_driver.get_property_min_max = null_get_property_min_max; vo->vo_driver.gui_data_exchange = null_gui_data_exchange; vo->vo_driver.exit = null_exit; vo->vo_driver.redraw_needed = null_redraw_needed; /* capabilities */ vo->m_capabilities = /*VO_CAP_COPIES_IMAGE |*/ VO_CAP_YV12 | VO_CAP_BRIGHTNESS; printf("done initialisation\n"); return (vo_driver_t*) vo; } static vo_info_t vo_info_null = { 5, "null plugin", NULL, VISUAL_TYPE_FB, 5 }; vo_info_t *get_video_out_plugin_info(){ vo_info_null.description = _("xine video output plugin using null device"); return &vo_info_null; } /* this is special for this device */ /** * We know that we will be controled by the XINE LIB++ */ /** * */ int null_is_showing_video( vo_driver_t* self ){ null_driver_t* this = (null_driver_t*)self; return this->m_show_video; } void null_set_show_video( vo_driver_t* self, int show ) { ((null_driver_t*)self)->m_show_video = show; } int null_is_fullscreen( vo_driver_t* self ){ return ((null_driver_t*)self)->m_video_fullscreen; } void null_set_fullscreen( vo_driver_t* self, int screen ){ ((null_driver_t*)self)->m_video_fullscreen = screen; } int null_is_scaling( vo_driver_t* self ){ return ((null_driver_t*)self)->m_is_scaling; } void null_set_scaling( vo_driver_t* self, int scale ){ ((null_driver_t*)self)->m_is_scaling = scale; } +void null_set_gui_width( vo_driver_t* self, int width ){ + +} +void null_set_gui_height( vo_driver_t* self, int height ){ + +} diff --git a/noncore/multimedia/opieplayer2/opieplayer2.pro b/noncore/multimedia/opieplayer2/opieplayer2.pro index 37208ef..a2cb987 100644 --- a/noncore/multimedia/opieplayer2/opieplayer2.pro +++ b/noncore/multimedia/opieplayer2/opieplayer2.pro @@ -1,19 +1,19 @@ TEMPLATE = app CONFIG = qt warn_on release #release DESTDIR = $(OPIEDIR)/bin HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h mediadetect.h\ videowidget.h audiowidget.h playlistwidget.h mediaplayer.h inputDialog.h \ - frame.h lib.h + frame.h lib.h xinevideowidget.h SOURCES = main.cpp \ playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp mediadetect.cpp\ videowidget.cpp audiowidget.cpp playlistwidget.cpp mediaplayer.cpp inputDialog.cpp \ - frame.cpp lib.cpp nullvideo.c -TARGET = opieplayer + frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp +TARGET = opieplayer2 INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe -lpthread -lopie -lxine -lxineutils INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp new file mode 100644 index 0000000..47f4805 --- a/dev/null +++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp @@ -0,0 +1,53 @@ + +/* + This file is part of the Opie Project + + Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> + Copyright (c) 2002 LJP <> + Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. 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 +..}^=.= = ; Library General Public License for more +++= -. .` .: details. + : = ...= . :.=- + -. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +*/ + +#include <qimage.h> +#include <qgfx_qws.h> + +#include "xinevideowidget.h" + +XineVideoWidget::XineVideoWidget( int width, + int height, + QWidget* parent, + const char* name ) + : QWidget( parent, name ) +{ + m_image = new QImage( width, height, qt_screen->depth() ); +} +XineVideoWidget::~XineVideoWidget() { + delete m_image; +} +void XineVideoWidget::paintEvent( QPaintEvent* e ) { + QWidget::paintEvent( e ); +} diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.h b/noncore/multimedia/opieplayer2/xinevideowidget.h new file mode 100644 index 0000000..46bb98b --- a/dev/null +++ b/noncore/multimedia/opieplayer2/xinevideowidget.h @@ -0,0 +1,51 @@ +/* + This file is part of the Opie Project + + Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> + Copyright (c) 2002 LJP <> + Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. 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 +..}^=.= = ; Library General Public License for more +++= -. .` .: details. + : = ...= . :.=- + -. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +*/ + + + +#include <qwidget.h> + +class QImage; +class XineVideoWidget : public QWidget { + Q_OBJECT +public: + XineVideoWidget( int width, int height, QWidget* parent, const char* name ); + ~XineVideoWidget(); + QImage *image() { return m_image; }; +protected: + void paintEvent( QPaintEvent* p ); +private: + QImage* m_image; + +}; + |