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
This commit is contained in:
Stephan Aßmus 2010-09-26 09:52:20 +00:00
parent 749df748eb
commit b6d5916a70
5 changed files with 20 additions and 177 deletions

View File

@ -1,7 +1,5 @@
SubDir HAIKU_TOP src apps mediaplayer ;
SetSubDirSupportedPlatformsBeOSCompatible ;
# for BRecentItems
UsePublicHeaders [ FDirName be_apps Tracker ] ;
UsePrivateHeaders interface shared ;

View File

@ -8,17 +8,7 @@
#include <stdio.h>
// 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 <Bitmap.h>
#ifndef __HAIKU__
#undef private
#endif
#include <Application.h>
#include <Region.h>
@ -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
}

View File

@ -10,9 +10,7 @@
#include <stdio.h>
#include <Autolock.h>
#ifdef __HAIKU__
# include <GradientLinear.h>
#endif
#include <GradientLinear.h>
#include <Message.h>
#include <ScrollBar.h>
#include <ScrollView.h>
@ -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
}

View File

@ -12,18 +12,15 @@
#include <stdio.h>
#include <Box.h>
#include <Button.h>
#include <CheckBox.h>
#include <GridLayoutBuilder.h>
#include <GroupLayoutBuilder.h>
#include <SpaceLayoutItem.h>
#include <String.h>
#include <StringView.h>
#include <RadioButton.h>
#include <View.h>
#include <Button.h>
#include <String.h>
#ifdef __HAIKU__
# include <GridLayoutBuilder.h>
# include <GroupLayoutBuilder.h>
# include <SpaceLayoutItem.h>
#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
}

View File

@ -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;