* Minor cleanup, no functional changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36222 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
33fbe25496
commit
bafcab9265
@ -43,12 +43,17 @@
|
||||
#include "SettingsWindow.h"
|
||||
|
||||
|
||||
MainApp* gMainApp;
|
||||
|
||||
static const char* kCurrentPlaylistFilename = "MediaPlayer Current Playlist";
|
||||
|
||||
const char* kAppSig = "application/x-vnd.Haiku-MediaPlayer";
|
||||
|
||||
MainApp* gMainApp;
|
||||
|
||||
static const char* kMediaServerSig = B_MEDIA_SERVER_SIGNATURE;
|
||||
static const char* kMediaServerAddOnSig = "application/x-vnd.Be.addon-host";
|
||||
|
||||
|
||||
MainApp::MainApp()
|
||||
:
|
||||
BApplication(kAppSig),
|
||||
@ -569,9 +574,6 @@ MainApp::_HandleFilePanelResult(BFilePanel* panel, const BMessage* message)
|
||||
}
|
||||
|
||||
|
||||
static const char* kCurrentPlaylistFilename = "MediaPlayer Current Playlist";
|
||||
|
||||
|
||||
void
|
||||
MainApp::_StoreCurrentPlaylist(const BMessage* message) const
|
||||
{
|
||||
@ -605,6 +607,7 @@ MainApp::_RestoreCurrentPlaylist(BMessage* message) const
|
||||
return message->Unflatten(&file);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MainApp::_InstallPlaylistMimeType()
|
||||
{
|
||||
|
@ -3,6 +3,11 @@
|
||||
* Copyright (c) 2000-2008, Stephan Aßmus <superstippi@gmx.de>,
|
||||
* All Rights Reserved. Distributed under the terms of the MIT license.
|
||||
*/
|
||||
|
||||
|
||||
//! This class controls our media nodes and general playback
|
||||
|
||||
|
||||
#include "NodeManager.h"
|
||||
|
||||
#include <stdio.h>
|
||||
@ -18,6 +23,7 @@
|
||||
#include "VideoProducer.h"
|
||||
#include "VideoSupplier.h"
|
||||
|
||||
|
||||
// debugging
|
||||
//#define TRACE_NODE_MANAGER
|
||||
#ifdef TRACE_NODE_MANAGER
|
||||
@ -30,15 +36,21 @@
|
||||
|
||||
#define print_error(str, status) printf(str ", error: %s\n", strerror(status))
|
||||
|
||||
|
||||
NodeManager::Connection::Connection()
|
||||
: connected(false)
|
||||
:
|
||||
connected(false)
|
||||
{
|
||||
memset(&format, 0, sizeof(media_format));
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
||||
// #pragma mark -
|
||||
|
||||
|
||||
NodeManager::NodeManager()
|
||||
: PlaybackManager(),
|
||||
:
|
||||
PlaybackManager(),
|
||||
fMediaRoster(NULL),
|
||||
fAudioProducer(NULL),
|
||||
fVideoConsumer(NULL),
|
||||
@ -56,14 +68,14 @@ NodeManager::NodeManager()
|
||||
{
|
||||
}
|
||||
|
||||
// destructor
|
||||
|
||||
NodeManager::~NodeManager()
|
||||
{
|
||||
_StopNodes();
|
||||
_TearDownNodes();
|
||||
}
|
||||
|
||||
// Init
|
||||
|
||||
status_t
|
||||
NodeManager::Init(BRect videoBounds, float videoFrameRate,
|
||||
color_space preferredVideoFormat, float audioFrameRate,
|
||||
@ -87,14 +99,14 @@ NodeManager::Init(BRect videoBounds, float videoFrameRate,
|
||||
audioFrameRate, audioChannels, enabledNodes, useOverlays, true);
|
||||
}
|
||||
|
||||
// InitCheck
|
||||
|
||||
status_t
|
||||
NodeManager::InitCheck()
|
||||
{
|
||||
return fStatus;
|
||||
}
|
||||
|
||||
// SetPlayMode
|
||||
|
||||
void
|
||||
NodeManager::SetPlayMode(int32 mode, bool continuePlaying)
|
||||
{
|
||||
@ -108,7 +120,7 @@ NodeManager::SetPlayMode(int32 mode, bool continuePlaying)
|
||||
PlaybackManager::SetPlayMode(mode, continuePlaying);
|
||||
}
|
||||
|
||||
// CleanupNodes
|
||||
|
||||
status_t
|
||||
NodeManager::CleanupNodes()
|
||||
{
|
||||
@ -116,7 +128,7 @@ NodeManager::CleanupNodes()
|
||||
return _TearDownNodes(false);
|
||||
}
|
||||
|
||||
// FormatChanged
|
||||
|
||||
status_t
|
||||
NodeManager::FormatChanged(BRect videoBounds, float videoFrameRate,
|
||||
color_space preferredVideoFormat, float audioFrameRate,
|
||||
@ -154,7 +166,7 @@ NodeManager::FormatChanged(BRect videoBounds, float videoFrameRate,
|
||||
return ret;
|
||||
}
|
||||
|
||||
// RealTimeForTime
|
||||
|
||||
bigtime_t
|
||||
NodeManager::RealTimeForTime(bigtime_t time) const
|
||||
{
|
||||
@ -170,7 +182,7 @@ NodeManager::RealTimeForTime(bigtime_t time) const
|
||||
return result;
|
||||
}
|
||||
|
||||
// TimeForRealTime
|
||||
|
||||
bigtime_t
|
||||
NodeManager::TimeForRealTime(bigtime_t time) const
|
||||
{
|
||||
@ -185,7 +197,7 @@ NodeManager::TimeForRealTime(bigtime_t time) const
|
||||
return result;
|
||||
}
|
||||
|
||||
// SetCurrentAudioTime
|
||||
|
||||
void
|
||||
NodeManager::SetCurrentAudioTime(bigtime_t time)
|
||||
{
|
||||
@ -197,7 +209,7 @@ NodeManager::SetCurrentAudioTime(bigtime_t time)
|
||||
}
|
||||
}
|
||||
|
||||
// SetVideoBounds
|
||||
|
||||
void
|
||||
NodeManager::SetVideoBounds(BRect bounds)
|
||||
{
|
||||
@ -207,14 +219,14 @@ NodeManager::SetVideoBounds(BRect bounds)
|
||||
}
|
||||
}
|
||||
|
||||
// VideoBounds
|
||||
|
||||
BRect
|
||||
NodeManager::VideoBounds() const
|
||||
{
|
||||
return fVideoBounds;
|
||||
}
|
||||
|
||||
// SetVideoTarget
|
||||
|
||||
void
|
||||
NodeManager::SetVideoTarget(VideoTarget* videoTarget)
|
||||
{
|
||||
@ -225,14 +237,14 @@ NodeManager::SetVideoTarget(VideoTarget* videoTarget)
|
||||
}
|
||||
}
|
||||
|
||||
// GetVideoTarget
|
||||
|
||||
VideoTarget*
|
||||
NodeManager::GetVideoTarget() const
|
||||
{
|
||||
return fVideoTarget;
|
||||
}
|
||||
|
||||
// SetVolume
|
||||
|
||||
void
|
||||
NodeManager::SetVolume(float percent)
|
||||
{
|
||||
@ -240,7 +252,7 @@ NodeManager::SetVolume(float percent)
|
||||
// our audio node...
|
||||
}
|
||||
|
||||
// SetPeakListener
|
||||
|
||||
void
|
||||
NodeManager::SetPeakListener(BHandler* handler)
|
||||
{
|
||||
@ -249,9 +261,10 @@ NodeManager::SetPeakListener(BHandler* handler)
|
||||
fAudioProducer->SetPeakListener(fPeakListener);
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
|
||||
// _SetUpNodes
|
||||
|
||||
status_t
|
||||
NodeManager::_SetUpNodes(color_space preferredVideoFormat, uint32 enabledNodes,
|
||||
bool useOverlays, float audioFrameRate, uint32 audioChannels)
|
||||
@ -309,7 +322,6 @@ fNoAudio = true;
|
||||
}
|
||||
|
||||
|
||||
// _SetUpVideoNodes
|
||||
status_t
|
||||
NodeManager::_SetUpVideoNodes(color_space preferredVideoFormat,
|
||||
bool useOverlays)
|
||||
@ -444,7 +456,7 @@ NodeManager::_SetUpVideoNodes(color_space preferredVideoFormat,
|
||||
return fStatus;
|
||||
}
|
||||
|
||||
// _SetUpAudioNodes
|
||||
|
||||
status_t
|
||||
NodeManager::_SetUpAudioNodes(float audioFrameRate, uint32 audioChannels)
|
||||
{
|
||||
@ -517,7 +529,7 @@ NodeManager::_SetUpAudioNodes(float audioFrameRate, uint32 audioChannels)
|
||||
return fStatus;
|
||||
}
|
||||
|
||||
// _TearDownNodes
|
||||
|
||||
status_t
|
||||
NodeManager::_TearDownNodes(bool disconnect)
|
||||
{
|
||||
@ -600,7 +612,7 @@ TRACE("NodeManager::_TearDownNodes() done\n");
|
||||
return err;
|
||||
}
|
||||
|
||||
// _StartNodes
|
||||
|
||||
status_t
|
||||
NodeManager::_StartNodes()
|
||||
{
|
||||
@ -712,7 +724,7 @@ printf("performance time for %lld: %lld\n", real + latency
|
||||
return status;
|
||||
}
|
||||
|
||||
// _StopNodes
|
||||
|
||||
void
|
||||
NodeManager::_StopNodes()
|
||||
{
|
||||
@ -739,4 +751,3 @@ NodeManager::_StopNodes()
|
||||
}
|
||||
TRACE("NodeManager::_StopNodes() done\n");
|
||||
}
|
||||
|
||||
|
@ -3,16 +3,15 @@
|
||||
* Copyright (c) 2000-2008, Stephan Aßmus <superstippi@gmx.de>,
|
||||
* All Rights Reserved. Distributed under the terms of the MIT license.
|
||||
*/
|
||||
|
||||
//! This class controls our media nodes and general playback
|
||||
|
||||
#ifndef NODE_MANAGER_H
|
||||
#define NODE_MANAGER_H
|
||||
|
||||
|
||||
#include <MediaNode.h>
|
||||
|
||||
#include "PlaybackManager.h"
|
||||
|
||||
|
||||
class BMediaRoster;
|
||||
class AudioProducer;
|
||||
class VideoTarget;
|
||||
@ -21,8 +20,9 @@ class VideoConsumer;
|
||||
class AudioSupplier;
|
||||
class VideoSupplier;
|
||||
|
||||
|
||||
class NodeManager : public PlaybackManager {
|
||||
public:
|
||||
public:
|
||||
NodeManager();
|
||||
virtual ~NodeManager();
|
||||
|
||||
@ -89,7 +89,7 @@ class NodeManager : public PlaybackManager {
|
||||
status_t _StartNodes();
|
||||
void _StopNodes();
|
||||
|
||||
private:
|
||||
private:
|
||||
struct Connection {
|
||||
Connection();
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
// PlaybackManager.cpp
|
||||
|
||||
|
||||
#include <algorithm>
|
||||
#include <stdio.h>
|
||||
|
||||
@ -13,8 +14,10 @@
|
||||
|
||||
#include "PlaybackManager.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
//#define TRACE_NODE_MANAGER
|
||||
#ifdef TRACE_NODE_MANAGER
|
||||
# define TRACE(x...) printf(x)
|
||||
@ -24,6 +27,7 @@ using namespace std;
|
||||
# define ERROR(x...) fprintf(stderr, x)
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
tdebug(const char* str)
|
||||
{
|
||||
|
@ -3,6 +3,7 @@
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#include "ImportPLItemsCommand.h"
|
||||
|
||||
#include <new>
|
||||
|
@ -20,6 +20,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "Playlist.h"
|
||||
|
||||
#include <debugger.h>
|
||||
|
@ -3,6 +3,7 @@
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#include "PlaylistListView.h"
|
||||
|
||||
#include <new>
|
||||
@ -32,6 +33,7 @@
|
||||
#include "RandomizePLItemsCommand.h"
|
||||
#include "RemovePLItemsCommand.h"
|
||||
|
||||
|
||||
using std::nothrow;
|
||||
|
||||
|
||||
@ -75,8 +77,12 @@ private:
|
||||
};
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
|
||||
|
||||
PlaylistListView::Item::Item(PlaylistItem* item)
|
||||
: SimpleItem(item->Name().String()),
|
||||
:
|
||||
SimpleItem(item->Name().String()),
|
||||
fItem(item)
|
||||
{
|
||||
fItem->AddListener(this);
|
||||
|
@ -176,9 +176,8 @@ PlaylistWindow::MessageReceived(BMessage* message)
|
||||
// player window, _not_ when it is dropped in this window
|
||||
// outside of the playlist!
|
||||
int32 appendIndex;
|
||||
if (message->FindInt32("append_index", &appendIndex) == B_OK) {
|
||||
if (message->FindInt32("append_index", &appendIndex) == B_OK)
|
||||
fListView->RefsReceived(message, appendIndex);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1,12 +1,11 @@
|
||||
/*
|
||||
* Copyright 2007, Haiku. All rights reserved.
|
||||
* Copyright 2007-2010, Haiku. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Stephan Aßmus <superstippi@gmx.de>
|
||||
* Fredrik Modéen <fredrik@modeen.se>
|
||||
*/
|
||||
|
||||
#ifndef PLAYLIST_WINDOW_H
|
||||
#define PLAYLIST_WINDOW_H
|
||||
|
||||
@ -16,6 +15,7 @@
|
||||
|
||||
#include "ListenerAdapter.h"
|
||||
|
||||
|
||||
class BMenuBar;
|
||||
class BMenuItem;
|
||||
class CommandStack;
|
||||
@ -27,10 +27,12 @@ class RWLocker;
|
||||
class BButton;
|
||||
class BFilePanel;
|
||||
|
||||
|
||||
enum {
|
||||
M_PLAYLIST_REMOVE_AND_PUT_INTO_TRASH = 'rmtr'
|
||||
};
|
||||
|
||||
|
||||
class PlaylistWindow : public BWindow {
|
||||
public:
|
||||
PlaylistWindow(BRect frame,
|
||||
@ -63,4 +65,5 @@ private:
|
||||
entry_ref fSavedPlaylistRef;
|
||||
};
|
||||
|
||||
|
||||
#endif // PLAYLIST_WINDOW_H
|
||||
|
Loading…
Reference in New Issue
Block a user