From b6d5916a70257d4dc875b7a6b03ee55e12158c7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sun, 26 Sep 2010 09:52:20 +0000 Subject: [PATCH] Since a lot of MediaPlayer code would actually not compile on BeOS anymore, I've removed the BeOS versions from the rest of the source. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38815 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/mediaplayer/Jamfile | 2 - src/apps/mediaplayer/VideoView.cpp | 18 +-- .../mediaplayer/playlist/PlaylistListView.cpp | 65 ++--------- .../mediaplayer/settings/SettingsWindow.cpp | 107 +----------------- .../supplier/MediaTrackAudioSupplier.cpp | 5 +- 5 files changed, 20 insertions(+), 177 deletions(-) diff --git a/src/apps/mediaplayer/Jamfile b/src/apps/mediaplayer/Jamfile index b01883b271..43ccf8b6e0 100644 --- a/src/apps/mediaplayer/Jamfile +++ b/src/apps/mediaplayer/Jamfile @@ -1,7 +1,5 @@ SubDir HAIKU_TOP src apps mediaplayer ; -SetSubDirSupportedPlatformsBeOSCompatible ; - # for BRecentItems UsePublicHeaders [ FDirName be_apps Tracker ] ; UsePrivateHeaders interface shared ; diff --git a/src/apps/mediaplayer/VideoView.cpp b/src/apps/mediaplayer/VideoView.cpp index 6304a36451..24638f45c9 100644 --- a/src/apps/mediaplayer/VideoView.cpp +++ b/src/apps/mediaplayer/VideoView.cpp @@ -8,17 +8,7 @@ #include -// XXX: Hack for BeOS: REMOVE ME later -#ifndef __HAIKU__ -#define private public -#define BitmapFlags(b) ((b)->fFlags) -#else -#define BitmapFlags(b) ((b)->Flags()) -#endif #include -#ifndef __HAIKU__ -#undef private -#endif #include #include @@ -145,7 +135,7 @@ VideoView::SetBitmap(const BBitmap* bitmap) if (LockBitmap()) { if (fOverlayMode - || (BitmapFlags(bitmap) & B_BITMAP_WILL_OVERLAY) != 0) { + || (bitmap->Flags() & B_BITMAP_WILL_OVERLAY) != 0) { if (!fOverlayMode) { // init overlay rgb_color key; @@ -182,7 +172,7 @@ VideoView::SetBitmap(const BBitmap* bitmap) | B_OVERLAY_TRANSFER_CHANNEL); } } else if (fOverlayMode - && (BitmapFlags(bitmap) & B_BITMAP_WILL_OVERLAY) == 0) { + && (bitmap->Flags() & B_BITMAP_WILL_OVERLAY) == 0) { fOverlayMode = false; ClearViewOverlay(); SetViewColor(B_TRANSPARENT_COLOR); @@ -292,12 +282,8 @@ VideoView::SetVideoFrame(const BRect& frame) void VideoView::_DrawBitmap(const BBitmap* bitmap) { -#ifdef __HAIKU__ uint32 options = fUseBilinearScaling ? B_FILTER_BITMAP_BILINEAR : 0; DrawBitmap(bitmap, bitmap->Bounds(), fVideoFrame, options); -#else - DrawBitmap(bitmap, bitmap->Bounds(), fVideoFrame); -#endif } diff --git a/src/apps/mediaplayer/playlist/PlaylistListView.cpp b/src/apps/mediaplayer/playlist/PlaylistListView.cpp index bd92955b65..8350843878 100644 --- a/src/apps/mediaplayer/playlist/PlaylistListView.cpp +++ b/src/apps/mediaplayer/playlist/PlaylistListView.cpp @@ -10,9 +10,7 @@ #include #include -#ifdef __HAIKU__ -# include -#endif +#include #include #include #include @@ -148,7 +146,6 @@ PlaylistListView::Item::Draw(BView* owner, BRect frame, const font_height& fh, r.OffsetTo(frame.left + 4, ceilf((frame.top + frame.bottom - playbackMarkSize) / 2)); -#ifdef __HAIKU__ uint32 flags = owner->Flags(); owner->SetFlags(flags | B_SUBPIXEL_PRECISE); @@ -177,43 +174,6 @@ PlaylistListView::Item::Draw(BView* owner, BRect frame, const font_height& fh, owner->FillShape(&shape, gradient); owner->SetFlags(flags); -#else - BPoint arrow[3]; - arrow[0] = r.LeftTop(); - arrow[1] = r.LeftBottom(); - arrow[2].x = r.right; - arrow[2].y = (r.top + r.bottom) / 2; - - rgb_color lightGreen = tint_color(green, B_LIGHTEN_2_TINT); - rgb_color darkGreen = tint_color(green, B_DARKEN_2_TINT); - owner->BeginLineArray(6); - // black outline - owner->AddLine(arrow[0], arrow[1], black); - owner->AddLine(BPoint(arrow[1].x + 1.0, arrow[1].y - 1.0), - arrow[2], black); - owner->AddLine(arrow[0], arrow[2], black); - // inset arrow - arrow[0].x += 1.0; - arrow[0].y += 2.0; - arrow[1].x += 1.0; - arrow[1].y -= 2.0; - arrow[2].x -= 2.0; - // highlights and shadow - owner->AddLine(arrow[1], arrow[2], darkGreen); - owner->AddLine(arrow[0], arrow[2], lightGreen); - owner->AddLine(arrow[0], arrow[1], lightGreen); - owner->EndLineArray(); - // fill green - arrow[0].x += 1.0; - arrow[0].y += 1.0; - arrow[1].x += 1.0; - arrow[1].y -= 1.0; - arrow[2].x -= 2.0; - - owner->SetLowColor(owner->HighColor()); - owner->SetHighColor(green); - owner->FillPolygon(arrow, 3); -#endif // __HAIKU__ } } @@ -241,28 +201,27 @@ PlaylistListView::Item::Draw(BView* owner, BRect frame, uint32 flags) PlaylistListView::PlaylistListView(BRect frame, Playlist* playlist, Controller* controller, CommandStack* stack) - : SimpleListView(frame, "playlist listview", NULL) + : + SimpleListView(frame, "playlist listview", NULL), - , fPlaylist(playlist) - , fPlaylistObserver(new PlaylistObserver(this)) + fPlaylist(playlist), + fPlaylistObserver(new PlaylistObserver(this)), - , fController(controller) - , fControllerObserver(new ControllerObserver(this, - OBSERVE_PLAYBACK_STATE_CHANGES)) + fController(controller), + fControllerObserver(new ControllerObserver(this, + OBSERVE_PLAYBACK_STATE_CHANGES)), - , fCommandStack(stack) + fCommandStack(stack), - , fCurrentPlaylistIndex(-1) - , fPlaybackState(PLAYBACK_STATE_STOPPED) + fCurrentPlaylistIndex(-1), + fPlaybackState(PLAYBACK_STATE_STOPPED), - , fLastClickedItem(NULL) + fLastClickedItem(NULL) { fPlaylist->AddListener(fPlaylistObserver); fController->AddListener(fControllerObserver); -#ifdef __HAIKU__ SetFlags(Flags() | B_SUBPIXEL_PRECISE); -#endif } diff --git a/src/apps/mediaplayer/settings/SettingsWindow.cpp b/src/apps/mediaplayer/settings/SettingsWindow.cpp index b753195215..f942d6f8c3 100644 --- a/src/apps/mediaplayer/settings/SettingsWindow.cpp +++ b/src/apps/mediaplayer/settings/SettingsWindow.cpp @@ -12,18 +12,15 @@ #include #include +#include #include +#include +#include +#include +#include #include #include #include -#include -#include - -#ifdef __HAIKU__ -# include -# include -# include -#endif enum { M_AUTOSTART = 0x3000, @@ -51,14 +48,8 @@ SettingsWindow::SettingsWindow(BRect frame) : BWindow(frame, "MediaPlayer settings", B_FLOATING_WINDOW_LOOK, B_FLOATING_APP_WINDOW_FEEL, B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_NOT_RESIZABLE -#ifdef __HAIKU__ | B_AUTO_UPDATE_SIZE_LIMITS) -#else - ) -#endif { -#ifdef __HAIKU__ - BBox* settingsBox = new BBox(B_PLAIN_BORDER, NULL); BGroupLayout* settingsLayout = new BGroupLayout(B_VERTICAL, 5); settingsBox->SetLayout(settingsLayout); @@ -180,94 +171,6 @@ SettingsWindow::SettingsWindow(BRect frame) .SetInsets(5, 5, 5, 5) ) ); - -#else - - frame = Bounds(); - BView* view = new BView(frame,"SettingsView",B_FOLLOW_ALL_SIDES,B_WILL_DRAW); - view->SetViewColor(216, 216, 216); - - BRect btnRect(80.00, frame.bottom - (SPACE + BUTTONHEIGHT), 145.00, - frame.bottom-SPACE); - - fRevertB = new BButton(btnRect, "revert", "Revert", - new BMessage(M_SETTINGS_REVERT)); - view->AddChild(fRevertB); - - btnRect.OffsetBy(btnRect.Width() + SPACE, 0); - BButton* btn = new BButton(btnRect, "btnCancel", "Cancel", - new BMessage(M_SETTINGS_CANCEL)); - view->AddChild(btn); - - btnRect.OffsetBy(btnRect.Width() + SPACE, 0); - btn = new BButton(btnRect, "btnOK", "OK", new BMessage(M_SETTINGS_SAVE)); - view->AddChild(btn); - - BRect rectBox(frame.left + SPACE, frame.top + SPACE, frame.right - SPACE, - btnRect.top- SPACE); - BBox* bbox = new BBox(rectBox, "box1", B_FOLLOW_ALL_SIDES,B_WILL_DRAW | B_NAVIGABLE, - B_FANCY_BORDER); - bbox->SetLabel("MediaPlayer Settings"); - - BFont font; - font_height fh1; - font.GetHeight(&fh1); - - BString str("Play Mode:"); - BRect rect(rectBox.left, rectBox.top + SPACE, rectBox.right - (12*2), - rectBox.top + fh1.leading + fh1.ascent + 10); - bbox->AddChild(new BStringView(rect, "stringViewPlayMode", str.String())); - - rect.OffsetBy(0, rect.Height()); - bbox->AddChild(fAutostartCB = new BCheckBox(rect, "chkboxAutostart", - "Automatically start playing", new BMessage(M_AUTOSTART))); - - rect.OffsetBy(SPACE, rect.Height() + SPACEING); - bbox->AddChild(fCloseWindowMoviesCB = new BCheckBox(rect, "chkBoxCloseWindowMovies", - "Close window when done playing movies", new BMessage(M_CLOSE_WINDOW_MOVIE))); - - rect.OffsetBy(0, rect.Height() + SPACEING); - bbox->AddChild(fCloseWindowSoundsCB = new BCheckBox(rect, "chkBoxCloseWindowSounds", - "Close window when done playing sounds", new BMessage(M_CLOSE_WINDOW_SOUNDS))); - - rect.OffsetBy(-SPACE, rect.Height() + SPACEING); - bbox->AddChild(fLoopMoviesCB = new BCheckBox(rect, "chkBoxLoopMovie", "Loop movies by default", - new BMessage(M_LOOP_MOVIE))); - - rect.OffsetBy(0, rect.Height() + SPACEING); - bbox->AddChild(fLoopSoundsCB = new BCheckBox(rect, "chkBoxLoopSounds", "Loop sounds by default", - new BMessage(M_LOOP_SOUND))); - - rect.OffsetBy(0, rect.Height() + SPACEING); - bbox->AddChild(fUseOverlaysCB = new BCheckBox(rect, "chkBoxUseOverlays", "Use hardware video overlays if available", - new BMessage(M_USE_OVERLAYS))); - - rect.OffsetBy(0, rect.Height() + SPACEING); - bbox->AddChild(fScaleBilinearCB = new BCheckBox(rect, "chkBoxScaleBilinear", "Scale movies smoothly (non-overlay mode)", - new BMessage(M_SCALE_BILINEAR))); - - rect.OffsetBy(0, rect.Height() + SPACE + SPACEING); - bbox->AddChild(new BStringView(rect, "stringViewPlayBackg", - "Play backgrounds clips at:")); - - rect.OffsetBy(SPACE, rect.Height() + SPACEING); - fFullVolumeBGMoviesRB = new BRadioButton(rect, "rdbtnfullvolume", - "Full Volume", new BMessage(M_START_FULL_VOLUME)); - bbox->AddChild(fFullVolumeBGMoviesRB); - - rect.OffsetBy(0, rect.Height() + SPACEING); - fHalfVolumeBGMoviesRB = new BRadioButton(rect, "rdbtnhalfvolume", - "Low Volume", new BMessage(M_START_HALF_VOLUME)); - bbox->AddChild(fHalfVolumeBGMoviesRB); - - rect.OffsetBy(0, rect.Height() + SPACEING); - fMutedVolumeBGMoviesRB = new BRadioButton(rect, "rdbtnfullvolume", "Muted", - new BMessage(M_START_MUTE_VOLUME)); - bbox->AddChild(fMutedVolumeBGMoviesRB); - - view->AddChild(bbox); - AddChild(view); -#endif } diff --git a/src/apps/mediaplayer/supplier/MediaTrackAudioSupplier.cpp b/src/apps/mediaplayer/supplier/MediaTrackAudioSupplier.cpp index f71a7b39d6..973f3d9d5f 100644 --- a/src/apps/mediaplayer/supplier/MediaTrackAudioSupplier.cpp +++ b/src/apps/mediaplayer/supplier/MediaTrackAudioSupplier.cpp @@ -617,13 +617,10 @@ status_t MediaTrackAudioSupplier::_FindKeyFrameForward(int64& position) { status_t error = B_OK; -#ifdef __HAIKU__ if (fHasKeyFrames) { error = fMediaTrack->FindKeyFrameForFrame( &position, B_MEDIA_SEEK_CLOSEST_FORWARD); - } else -#endif - { + } else { int64 framesPerBuffer = _FramesPerBuffer(); position += framesPerBuffer - 1; position = position % framesPerBuffer;