1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 16:49:41 +02:00
audacity/lib-src/FileDialog/win/FileDialogPrivate.h
James Crook 1c988b4e3a Automation: AudacityCommand
This is a squash of 50 commits.

This merges the capabilities of BatchCommands and Effects using a new
AudacityCommand class.  AudacityCommand provides one function to specify the
parameters, and then we leverage that one function in automation, whether by chains,
mod-script-pipe or (future) Nyquist.

- Now have AudacityCommand which is using the same mechanism as Effect
- Has configurable parameters
- Has data-entry GUI (built using shuttle GUI)
- Registers with PluginManager.
- Menu commands now provided in chains, and to python batch.
   - Tested with Zoom Toggle.

- ShuttleParams now can set, get, set defaults, validate and specify
the parameters.
- Bugfix: Don't overwrite values with defaults first time out.
- Add DefineParams function for all built-in effects.
- Extend CommandContext to carry output channels for results.

We abuse EffectsManager.  It handles both Effects and
AudacityCommands now.  In time an Effect should become a special case of
AudacityCommand and we'll split and rename the EffectManager class.

- Don't use 'default' as a parameter name.
- Massive renaming for CommandDefinitionInterface
- EffectIdentInterface becomes EffectDefinitionInterface
- EffectAutomationParameters becomes CommandAutomationParameters
- PluginType is now a bit field.

This way we can search for related types at the same time.

- Most old batch commands made into AudacityCommands.
The ones that weren't are for a reason.  They are used by mod-script-pipe
to carry commands and responses across from a non-GUI thread to the GUI
thread.

- Major tidy up of ScreenshotCommand
- Reworking of SelectCommand
- GetPreferenceCommand and SetPreferenceCommand
- GetTrackInfo and SetTrackInfo
- GetInfoCommand
- Help, Open, Save, Import and Export commands.
- Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo
  which are now better handled by other commands.

- JSONify "GetInfo: Commands" output, i.e. commas in the right places.

- General work on better Doxygen.
    - Lyrics -> LyricsPanel
    - Meter -> MeterPanel
- Updated Linux makefile.
- Scripting commands added into Extra menu.
- Distinct names for previously duplicated find-clipping parameters.
- Fixed longstanding error with erroneous status field number which
  previously caused an ASSERT in debug.
- Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-02-24 14:20:22 -05:00

125 lines
3.9 KiB
C++

//
// Copied from wxWidgets 3.0.2 and modified for Audacity
//
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/filedlg.h
// Purpose: wxFileDialog class
// Author: Julian Smart
// Modified by: Leland Lucius
// Created: 01/02/97
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WIN_FILEDIALOGPRIVATE_H_
#define _WIN_FILEDIALOGPRIVATE_H_
#include <windows.h>
#include <wx/modalhook.h>
//-------------------------------------------------------------------------
// FileDialog
//-------------------------------------------------------------------------
class AUDACITY_DLL_API FileDialog : public FileDialogBase
{
public:
FileDialog();
FileDialog(wxWindow *parent,
const wxString& message = wxFileSelectorPromptStr,
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxFileDialogNameStr);
virtual void GetPaths(wxArrayString& paths) const;
virtual void GetFilenames(wxArrayString& files) const;
virtual int ShowModal();
protected:
// -----------------------------------------
// wxMSW-specific implementation from now on
// -----------------------------------------
#if !(defined(__SMARTPHONE__) && defined(__WXWINCE__))
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual void DoCentre(int dir);
virtual void DoGetSize(int *width, int *height) const;
virtual void DoGetPosition(int *x, int *y) const;
#endif // !(__SMARTPHONE__ && __WXWINCE__)
private:
void Init();
wxString GetFullPath(HWND hwnd, int itm);
void FilterFiles(HWND hwnd, bool refresh);
void ParseFilter(int index);
// Parent dialog hook
static UINT_PTR APIENTRY ParentHook(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam);
virtual UINT_PTR MSWParentHook(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam, OPENFILENAME *pOfn);
// Message handlers for the parent dialog
virtual void MSWOnSize(HWND hwnd, LPOPENFILENAME pOfn);
virtual void MSWOnGetMinMaxInfo(HWND hwnd, LPOPENFILENAME pOfn, LPMINMAXINFO pMmi);
// Child dialog hook
static UINT_PTR APIENTRY DialogHook(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam);
virtual UINT_PTR MSWDialogHook(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam, OPENFILENAME *pOfn);
// Message handlers for the child dialog
virtual void MSWOnInitDialog(HWND hwnd, LPOPENFILENAME pOfn);
virtual void MSWOnDestroy(HWND hwnd, LPOPENFILENAME pOfn);
virtual void MSWOnInitDone(HWND hwnd, LPOPENFILENAME pOfn);
virtual void MSWOnFolderChange(HWND hwnd, LPOPENFILENAME pOfn);
virtual void MSWOnSelChange(HWND hwnd, LPOPENFILENAME pOfn);
virtual void MSWOnTypeChange(HWND hwnd, LPOPENFILENAME pOfn);
private:
wxArrayString m_fileNames;
// remember if our SetPosition() or Centre() (which requires special
// treatment) was called
bool m_bMovedWindow;
int m_centreDir; // nothing to do if 0
wxArrayString m_FilterGroups;
wxArrayString m_Filters;
wxChar *m_NameBuf;
int m_NameBufLen;
HWND mParentDlg;
HWND mChildDlg;
WNDPROC mParentProc;
POINT mMinSize;
wxPanel *mRoot;
class Disabler : public wxModalDialogHook
{
public:
Disabler();
void Init(wxWindow *root, HWND hwnd);
protected:
int Enter(wxDialog *dialog);
void Exit(wxDialog *dialog);
bool IsChild(const wxDialog *dialog) const;
private:
wxWindow *mRoot;
HWND mHwnd;
int mModalCount;
} mDisabler;
DECLARE_DYNAMIC_CLASS(FileDialog)
DECLARE_NO_COPY_CLASS(FileDialog)
};
#endif