mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-31 16:09:28 +02:00
Added TrackPanel2. Removed namespaces, as they don't help avoid collision with TrackPanel name.
This commit is contained in:
parent
214b405646
commit
fe4a271fa1
@ -111,6 +111,7 @@ void ModTrackPanelCommandFunctor::operator()(int index )
|
|||||||
void ModTrackPanelCallback::OnFuncShowAudioExplorer()
|
void ModTrackPanelCallback::OnFuncShowAudioExplorer()
|
||||||
{
|
{
|
||||||
int k=3;
|
int k=3;
|
||||||
|
Registrar::ShowNewPanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModTrackPanelCallback::OnFuncShowAnotherExtension()
|
void ModTrackPanelCallback::OnFuncShowAnotherExtension()
|
||||||
@ -148,10 +149,10 @@ MOD_TRACK_PANEL_DLL_API int ModuleDispatch(ModuleDispatchTypes type)
|
|||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case AppInitialized:
|
case AppInitialized:
|
||||||
ModTrackPanel::Registrar::Start();
|
Registrar::Start();
|
||||||
break;
|
break;
|
||||||
case AppQuiting:
|
case AppQuiting:
|
||||||
ModTrackPanel::Registrar::Finish();
|
Registrar::Finish();
|
||||||
break;
|
break;
|
||||||
case ProjectInitialized:
|
case ProjectInitialized:
|
||||||
case MenusRebuilt:
|
case MenusRebuilt:
|
||||||
|
@ -21,8 +21,6 @@ plugging in of new resources.
|
|||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
#include "Registrar.h"
|
#include "Registrar.h"
|
||||||
|
|
||||||
START_NAMESPACE
|
|
||||||
|
|
||||||
Registrar * pRegistrar = NULL;
|
Registrar * pRegistrar = NULL;
|
||||||
|
|
||||||
// By defining the external function and including it here, we save ourselves maintaing two lists.
|
// By defining the external function and including it here, we save ourselves maintaing two lists.
|
||||||
@ -44,6 +42,7 @@ int RegistrarDispatch( t_RegistrarDispatchType Type )
|
|||||||
DISPATCH( EnvelopeArtist );
|
DISPATCH( EnvelopeArtist );
|
||||||
DISPATCH( LabelArtist );
|
DISPATCH( LabelArtist );
|
||||||
DISPATCH( DragGridSizer );
|
DISPATCH( DragGridSizer );
|
||||||
|
DISPATCH( TrackPanel2 );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,6 +53,7 @@ void Registrar::Start()
|
|||||||
wxASSERT( pRegistrar ==NULL );
|
wxASSERT( pRegistrar ==NULL );
|
||||||
pRegistrar = new Registrar();
|
pRegistrar = new Registrar();
|
||||||
|
|
||||||
|
RegistrarDispatch( RegResource );
|
||||||
RegistrarDispatch( RegArtist );
|
RegistrarDispatch( RegArtist );
|
||||||
RegistrarDispatch( RegDataType );
|
RegistrarDispatch( RegDataType );
|
||||||
RegistrarDispatch( RegCommand );
|
RegistrarDispatch( RegCommand );
|
||||||
@ -69,6 +69,9 @@ void Registrar::Finish()
|
|||||||
pRegistrar = NULL;
|
pRegistrar = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Registrar::ShowNewPanel()
|
||||||
|
{
|
||||||
};//End of Namespace.
|
wxASSERT( pRegistrar !=NULL );
|
||||||
|
if( pRegistrar->pShowFn != NULL)
|
||||||
|
pRegistrar->pShowFn();
|
||||||
|
}
|
@ -13,16 +13,9 @@
|
|||||||
#ifndef __AUDACITY_REGISTRAR__
|
#ifndef __AUDACITY_REGISTRAR__
|
||||||
#define __AUDACITY_REGISTRAR__
|
#define __AUDACITY_REGISTRAR__
|
||||||
|
|
||||||
// MSVC auto-indents, but I don't want that, for the namespace.
|
|
||||||
// so using a macro for that works around ir
|
|
||||||
// AND allows me to change the namespace name easily.
|
|
||||||
|
|
||||||
#define START_NAMESPACE namespace ModTrackPanel {
|
|
||||||
|
|
||||||
START_NAMESPACE
|
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
RegResource,
|
||||||
RegArtist,
|
RegArtist,
|
||||||
RegDataType,
|
RegDataType,
|
||||||
RegCommand,
|
RegCommand,
|
||||||
@ -31,14 +24,22 @@ typedef enum
|
|||||||
} t_RegistrarDispatchType;
|
} t_RegistrarDispatchType;
|
||||||
|
|
||||||
class Registrar {
|
class Registrar {
|
||||||
|
Registrar::Registrar(){
|
||||||
|
pShowFn = NULL;}
|
||||||
public:
|
public:
|
||||||
|
// Fairly generic registrar functions.
|
||||||
static void Start();
|
static void Start();
|
||||||
static void Finish();
|
static void Finish();
|
||||||
|
|
||||||
|
// Somewhat specific to this application registrar functions.
|
||||||
|
// These mostly reflect one-offs, where a more sophisticated
|
||||||
|
// system would manage a list.
|
||||||
|
static void ShowNewPanel();
|
||||||
|
public:
|
||||||
|
void (*pShowFn)(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
extern int RegistrarDispatch( t_RegistrarDispatchType Type );
|
extern int RegistrarDispatch( t_RegistrarDispatchType Type );
|
||||||
|
|
||||||
};//End of Namespace.
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -11,19 +11,15 @@
|
|||||||
|
|
||||||
********************************************************************//**
|
********************************************************************//**
|
||||||
|
|
||||||
\class Registrar
|
\class SkewedRuller
|
||||||
\brief Registrar is a class that other classes register resources of
|
\brief SkewedRuler draws a ruler for aligning two sequences.
|
||||||
various kinds with. It makes a system that is much more amenable to
|
|
||||||
plugging in of new resources.
|
|
||||||
|
|
||||||
*//********************************************************************/
|
*//********************************************************************/
|
||||||
|
|
||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
|
#include "Registrar.h"
|
||||||
#include "SkewedRuler.h"
|
#include "SkewedRuler.h"
|
||||||
|
|
||||||
START_NAMESPACE
|
|
||||||
|
|
||||||
|
|
||||||
extern int SkewedRulerDispatch( Registrar & R, t_RegistrarDispatchType Type )
|
extern int SkewedRulerDispatch( Registrar & R, t_RegistrarDispatchType Type )
|
||||||
{
|
{
|
||||||
switch( Type )
|
switch( Type )
|
||||||
@ -137,4 +133,4 @@ int DragGridSizerDispatch( Registrar & R, t_RegistrarDispatchType Type )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};//End of Namespace.
|
|
||||||
|
@ -13,13 +13,11 @@
|
|||||||
#ifndef __AUDACITY_SKEWED_RULER__
|
#ifndef __AUDACITY_SKEWED_RULER__
|
||||||
#define __AUDACITY_SKEWED_RULER__
|
#define __AUDACITY_SKEWED_RULER__
|
||||||
|
|
||||||
#include "Registrar.h"
|
|
||||||
START_NAMESPACE
|
|
||||||
|
|
||||||
class SkewedRuler {
|
class SkewedRuler {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};//End of Namespace.
|
|
||||||
#endif
|
#endif
|
||||||
|
107
lib-src/mod-track-panel/TrackPanel2.cpp
Normal file
107
lib-src/mod-track-panel/TrackPanel2.cpp
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
/**********************************************************************
|
||||||
|
|
||||||
|
Audacity: A Digital Audio Editor
|
||||||
|
|
||||||
|
Registrar.cpp
|
||||||
|
|
||||||
|
James Crook
|
||||||
|
|
||||||
|
Audacity is free software.
|
||||||
|
This file is licensed under the wxWidgets license, see License.txt
|
||||||
|
|
||||||
|
********************************************************************//**
|
||||||
|
|
||||||
|
\class TrackPanel2
|
||||||
|
\brief TrackPanel2 is the start of the new TrackPanel.
|
||||||
|
|
||||||
|
*//********************************************************************/
|
||||||
|
|
||||||
|
#include <wx/wx.h>
|
||||||
|
#include "ShuttleGui.h"
|
||||||
|
#include "widgets/LinkingHtmlWindow.h"
|
||||||
|
#include "SkewedRuler.h"
|
||||||
|
#include "Registrar.h"
|
||||||
|
#include "TrackPanel2.h"
|
||||||
|
|
||||||
|
|
||||||
|
void ShowTrackPanel()
|
||||||
|
{
|
||||||
|
int k=42;
|
||||||
|
|
||||||
|
wxDialog Dlg(NULL, wxID_ANY, wxString(wxT("Experimental New TrackPanel")));
|
||||||
|
ShuttleGui S(&Dlg, eIsCreating);
|
||||||
|
#if 0
|
||||||
|
S.StartHorizontalLay(wxCENTER, false);
|
||||||
|
{
|
||||||
|
S.StartStatic(wxT(""), false);
|
||||||
|
{
|
||||||
|
S.SetBorder(200);
|
||||||
|
S.AddFixedText(wxT("AAA"));
|
||||||
|
}
|
||||||
|
S.EndStatic();
|
||||||
|
}
|
||||||
|
S.EndHorizontalLay();
|
||||||
|
#endif
|
||||||
|
S.StartNotebook();
|
||||||
|
{
|
||||||
|
S.StartNotebookPage( _("Panel") );
|
||||||
|
S.StartVerticalLay(1);
|
||||||
|
{
|
||||||
|
HtmlWindow *html = new LinkingHtmlWindow(S.GetParent(), -1,
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxSize(600, 359),
|
||||||
|
wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER);
|
||||||
|
html->SetFocus();
|
||||||
|
html->SetPage(wxT("<h1><font color=\"blue\">TrackPanel</font></h1>This will be replaced with the panel"));
|
||||||
|
S.Prop(1).AddWindow( html, wxEXPAND );
|
||||||
|
}
|
||||||
|
S.EndVerticalLay();
|
||||||
|
S.EndNotebookPage();
|
||||||
|
|
||||||
|
S.StartNotebookPage( _("Diagnostics") );
|
||||||
|
S.StartVerticalLay(1);
|
||||||
|
{
|
||||||
|
HtmlWindow *html = new LinkingHtmlWindow(S.GetParent(), -1,
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxSize(600, 359),
|
||||||
|
wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER);
|
||||||
|
html->SetFocus();
|
||||||
|
html->SetPage(wxT("<h1>Diagnostics</h1>This is an html diagnostics page"));
|
||||||
|
S.Prop(1).AddWindow( html, wxEXPAND );
|
||||||
|
}
|
||||||
|
S.EndVerticalLay();
|
||||||
|
S.EndNotebookPage();
|
||||||
|
}
|
||||||
|
S.EndNotebook();
|
||||||
|
|
||||||
|
wxButton *ok = new wxButton(S.GetParent(), wxID_OK, _("OK... Audacious!"));
|
||||||
|
ok->SetDefault();
|
||||||
|
S.Prop(0).AddWindow( ok );
|
||||||
|
|
||||||
|
Dlg.Fit();
|
||||||
|
|
||||||
|
Dlg.ShowModal();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int TrackPanel2Dispatch( Registrar & R, t_RegistrarDispatchType Type )
|
||||||
|
{
|
||||||
|
switch( Type )
|
||||||
|
{
|
||||||
|
case RegResource:
|
||||||
|
R.pShowFn = ShowTrackPanel;
|
||||||
|
break;
|
||||||
|
case RegArtist:
|
||||||
|
break;
|
||||||
|
case RegDataType:
|
||||||
|
break;
|
||||||
|
case RegCommand:
|
||||||
|
break;
|
||||||
|
case RegMenuItem:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
20
lib-src/mod-track-panel/TrackPanel2.h
Normal file
20
lib-src/mod-track-panel/TrackPanel2.h
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
/**********************************************************************
|
||||||
|
|
||||||
|
Audacity: A Digital Audio Editor
|
||||||
|
|
||||||
|
TrackPanel2.h
|
||||||
|
|
||||||
|
James Crook
|
||||||
|
|
||||||
|
**********************************************************************/
|
||||||
|
|
||||||
|
#ifndef __AUDACITY_TRACK_PANEL2__
|
||||||
|
#define __AUDACITY_TRACK_PANEL2__
|
||||||
|
|
||||||
|
|
||||||
|
class TrackPanel2 {
|
||||||
|
public:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -63,7 +63,7 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies="wxmsw28ud_core.lib wxbase28ud.lib odbc32.lib odbccp32.lib oldnames.lib comctl32.lib rpcrt4.lib wsock32.lib netapi32.lib Audacity.lib"
|
AdditionalDependencies="wxmsw28ud_core.lib wxbase28ud.lib wxmsw28ud_html.lib odbc32.lib odbccp32.lib oldnames.lib comctl32.lib rpcrt4.lib wsock32.lib netapi32.lib Audacity.lib"
|
||||||
OutputFile="$(OutDir)\modules\$(ProjectName).dll"
|
OutputFile="$(OutDir)\modules\$(ProjectName).dll"
|
||||||
AdditionalLibraryDirectories=""$(WXWIN)\lib\vc_dll";"$(OutDir)""
|
AdditionalLibraryDirectories=""$(WXWIN)\lib\vc_dll";"$(OutDir)""
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
@ -138,7 +138,7 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies="wxmsw28u_core.lib wxbase28u.lib odbc32.lib odbccp32.lib oldnames.lib comctl32.lib rpcrt4.lib wsock32.lib netapi32.lib Audacity.lib"
|
AdditionalDependencies="wxmsw28u_core.lib wxbase28u.lib wxmsw28u_html.lib odbc32.lib odbccp32.lib oldnames.lib comctl32.lib rpcrt4.lib wsock32.lib netapi32.lib Audacity.lib"
|
||||||
OutputFile="$(OutDir)\modules\$(ProjectName).dll"
|
OutputFile="$(OutDir)\modules\$(ProjectName).dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
AdditionalLibraryDirectories=""$(WXWIN)\lib\vc_dll";"$(OutDir)""
|
AdditionalLibraryDirectories=""$(WXWIN)\lib\vc_dll";"$(OutDir)""
|
||||||
@ -203,6 +203,14 @@
|
|||||||
RelativePath=".\SkewedRuler.h"
|
RelativePath=".\SkewedRuler.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\TrackPanel2.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\TrackPanel2.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
</Files>
|
</Files>
|
||||||
<Globals>
|
<Globals>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user