New Media (Mixer) application by Sikosis (beos@gravity24hr.com)

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2788 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Phil Greenway 2003-02-22 05:03:15 +00:00
parent e13a428ed3
commit 4fcc31827d
9 changed files with 308 additions and 4 deletions

View File

@ -3,9 +3,8 @@ SubDir OBOS_TOP src prefs media ;
UsePrivateHeaders media ;
Preference Media :
MediaPrefsApp.cpp
MediaPrefsWindow.cpp
MediaPrefsView.cpp
MediaPrefsSlider.cpp ;
Media.cpp
MediaWindow.cpp
MediaViews.cpp
LinkSharedOSLibs Media : be libmedia.so ;

72
src/prefs/media/Media.cpp Normal file
View File

@ -0,0 +1,72 @@
/*
Media by Sikosis
(C)2003
*/
// Includes -------------------------------------------------------------------------------------------------- //
#include <Alert.h>
#include <Application.h>
#include <Button.h>
#include <Deskbar.h>
#include <Entry.h>
#include <File.h>
#include <FilePanel.h>
#include <ListView.h>
#include <Path.h>
#include <Screen.h>
#include <ScrollView.h>
#include <stdio.h>
#include <string.h>
#include <TextControl.h>
#include <Window.h>
#include <View.h>
#include "Media.h"
#include "MediaWindows.h"
#include "MediaViews.h"
#include "MediaConstants.h"
// ---------------------------------------------------------------------------------------------------------- //
MediaWindow *ptrMediaWindow;
// Media -- constructor
Media::Media() : BApplication (APP_SIGNATURE)
{
// Default Window Size - even though we centre the form to the current screen size
BRect screenFrame = (BScreen(B_MAIN_SCREEN_ID).Frame());
float FormTopDefault = 0;
float FormLeftDefault = 0;
float FormWidthDefault = 654;
float FormHeightDefault = 392;
BRect MediaWindowRect(FormTopDefault,FormLeftDefault,FormLeftDefault+FormWidthDefault,FormTopDefault+FormHeightDefault);
ptrMediaWindow = new MediaWindow(MediaWindowRect);
}
// ---------------------------------------------------------------------------------------------------------- //
// Media::MessageReceived -- handles incoming messages
void Media::MessageReceived (BMessage *message)
{
switch(message->what)
{
default:
BApplication::MessageReceived(message); // pass it along ...
break;
}
}
// ---------------------------------------------------------------------------------------------------------- //
// Media Main
int main(void)
{
Media theApp;
theApp.Run();
return 0;
}
// end ------------------------------------------------------------------------------------------------------ //

24
src/prefs/media/Media.h Normal file
View File

@ -0,0 +1,24 @@
/*
Media Header by Sikosis
(C)2003
*/
#ifndef __MEDIA_H__
#define __MEDIA_H__
extern const char *APP_SIGNATURE;
class Media : public BApplication
{
public:
Media();
virtual void MessageReceived(BMessage *message);
private:
};
#endif

View File

@ -0,0 +1,16 @@
/*
Media Constants by Sikosis
(C)2003
*/
#ifndef __MEDIACONSTANTS_H__
#define __MEDIACONSTANTS_H__
// Constants ------------------------------------------------------------------------------------------------- //
const char *APP_SIGNATURE = "application/x-vnd.OBOS.Media"; // Application Signature and Title
#endif

View File

@ -0,0 +1,36 @@
/*
MediaViews by Sikosis
(C)2003
*/
// Includes -------------------------------------------------------------------------------------------------- //
#include <Alert.h>
#include <Application.h>
#include <Screen.h>
#include <stdio.h>
#include <Window.h>
#include <View.h>
#include "MediaWindows.h"
#include "MediaViews.h"
//#include "MediaConstants.h"
// ------------------------------------------------------------------------------------------------------------- //
// MediaView - Constructor
MediaView::MediaView (BRect frame) : BView (frame, "MediaView", B_FOLLOW_ALL_SIDES, B_WILL_DRAW )
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
}
// ---------------------------------------------------------------------------------------------------------- //
void MediaView::Draw(BRect updateRect)
{
BRect r;
r = Bounds();
}
// ---------------------------------------------------------------------------------------------------------- //

View File

@ -0,0 +1,22 @@
/*
MediaViews Header by Sikosis
(C)2002
*/
#ifndef __MEDIAVIEWS_H__
#define __MEDIAVIEWS_H__
#include "Media.h"
#include "MediaWindows.h"
class MediaView : public BView
{
public:
MediaView(BRect frame);
virtual void Draw(BRect updateRect);
};
#endif

View File

@ -0,0 +1,104 @@
/*
Media - MediaWindow by Sikosis
(C)2003
*/
// Includes -------------------------------------------------------------------------------------------------- //
#include <Alert.h>
#include <Application.h>
#include <Bitmap.h>
#include <Button.h>
#include <Path.h>
#include <Screen.h>
#include <ScrollView.h>
#include <Shape.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <TextView.h>
#include <TextControl.h>
#include <Window.h>
#include <View.h>
#include "Media.h"
#include "MediaViews.h"
#include "MediaWindows.h"
// CenterWindowOnScreen -- Centers the BWindow to the Current Screen
static void CenterWindowOnScreen(BWindow* w)
{
BRect screenFrame = (BScreen(B_MAIN_SCREEN_ID).Frame());
BPoint pt;
pt.x = screenFrame.Width()/2 - w->Bounds().Width()/2;
pt.y = screenFrame.Height()/2 - w->Bounds().Height()/2;
if (screenFrame.Contains(pt))
w->MoveTo(pt);
}
// ---------------------------------------------------------------------------------------------------------- //
// MediaWindow - Constructor
MediaWindow::MediaWindow(BRect frame) : BWindow (frame, "OBOS Media", B_TITLED_WINDOW, B_NORMAL_WINDOW_FEEL , 0)
{
InitWindow();
CenterWindowOnScreen(this);
Show();
}
// MediaWindow - Destructor
MediaWindow::~MediaWindow()
{
exit(0);
}
// MediaWindow::InitWindow -- Initialization Commands here
void MediaWindow::InitWindow(void)
{
BRect r;
r = Bounds(); // the whole view
// Create the Views
AddChild(ptrMediaView = new MediaView(r));
}
// ---------------------------------------------------------------------------------------------------------- //
// MediaWindow::QuitRequested -- Post a message to the app to quit
bool MediaWindow::QuitRequested()
{
be_app->PostMessage(B_QUIT_REQUESTED);
return true;
}
// ---------------------------------------------------------------------------------------------------------- //
// MediaWindow::FrameResized -- When the main frame is resized fix up the other views
void MediaWindow::FrameResized (float width, float height)
{
// This makes sure our SideBar colours down to the bottom when resized
BRect r;
r = Bounds();
}
// ---------------------------------------------------------------------------------------------------------- //
// MediaWindow::MessageReceived -- receives messages
void MediaWindow::MessageReceived (BMessage *message)
{
switch(message->what)
{
default:
BWindow::MessageReceived(message);
break;
}
}
// ---------------------------------------------------------------------------------------------------------- //

View File

@ -0,0 +1,31 @@
/*
Media Windows Header by Sikosis
(C)2003
*/
#ifndef __MEDIAWINDOWS_H__
#define __MEDIAWINDOWS_H__
#include "Media.h"
#include "MediaViews.h"
class MediaView;
class MediaWindow : public BWindow
{
public:
MediaWindow(BRect frame);
~MediaWindow();
virtual bool QuitRequested();
virtual void MessageReceived(BMessage *message);
virtual void FrameResized(float width, float height);
private:
void InitWindow(void);
MediaView* ptrMediaView;
};
#endif

BIN
src/prefs/media/media.rsrc Normal file

Binary file not shown.