mirror of
https://github.com/tildearrow/furnace.git
synced 2024-12-28 10:31:25 +00:00
prepare for ins preview in system file picker
This commit is contained in:
parent
8a1f544eef
commit
03e31c441e
9 changed files with 58 additions and 19 deletions
|
@ -521,7 +521,7 @@ src/gui/gui.cpp
|
|||
)
|
||||
|
||||
if (WIN32 OR APPLE)
|
||||
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_common.c)
|
||||
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_common.cpp)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
|
@ -530,7 +530,7 @@ endif()
|
|||
|
||||
if (APPLE)
|
||||
list(APPEND GUI_SOURCES src/gui/macstuff.m)
|
||||
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_cocoa.m)
|
||||
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_cocoa.mm)
|
||||
endif()
|
||||
|
||||
if (NOT WIN32 AND NOT APPLE)
|
||||
|
|
9
extern/nfd-modified/src/include/nfd.h
vendored
9
extern/nfd-modified/src/include/nfd.h
vendored
|
@ -10,10 +10,6 @@
|
|||
#ifndef _NFD_H
|
||||
#define _NFD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
/* denotes UTF-8 char */
|
||||
|
@ -66,9 +62,4 @@ nfdchar_t *NFD_PathSet_GetPath( const nfdpathset_t *pathSet, size_t index );
|
|||
/* Free the pathSet */
|
||||
void NFD_PathSet_Free( nfdpathset_t *pathSet );
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -8,6 +8,12 @@
|
|||
#include "nfd.h"
|
||||
#include "nfd_common.h"
|
||||
|
||||
// this language is a mess!
|
||||
// who thought it was a good idea to combine Objective-C and C++ together
|
||||
// when you could just have used C++ and call it a day!!!
|
||||
//
|
||||
// might as well make Objective-Ruswift++...
|
||||
|
||||
static NSArray *BuildAllowedFileTypes( const char *filterList )
|
||||
{
|
||||
// Commas and semicolons are the same thing on this platform
|
8
extern/nfd-modified/src/nfd_common.h
vendored
8
extern/nfd-modified/src/nfd_common.h
vendored
|
@ -14,10 +14,6 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define NFD_MAX_STRLEN 256
|
||||
#define _NFD_UNUSED(x) ((void)x)
|
||||
|
||||
|
@ -30,10 +26,6 @@ void NFDi_SetError( const char *msg );
|
|||
int NFDi_SafeStrncpy( char *dst, const char *src, size_t maxCopy );
|
||||
int32_t NFDi_UTF8_Strlen( const nfdchar_t *str );
|
||||
int NFDi_IsFilterSegmentChar( char ch );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
|
1
extern/nfd-modified/src/nfd_win.cpp
vendored
1
extern/nfd-modified/src/nfd_win.cpp
vendored
|
@ -423,6 +423,7 @@ nfdresult_t NFD_OpenDialog( const nfdchar_t *filterList,
|
|||
}
|
||||
|
||||
// Show the dialog.
|
||||
// TODO: pass the Furnace window here
|
||||
result = fileOpenDialog->Show(NULL);
|
||||
if ( SUCCEEDED(result) )
|
||||
{
|
||||
|
|
49
papers/newIns.md
Normal file
49
papers/newIns.md
Normal file
|
@ -0,0 +1,49 @@
|
|||
# possible new Furnace instrument format
|
||||
|
||||
the main issue with Furnace instrument files is that they are too big, even if the instrument is nothing more than the FM setup...
|
||||
|
||||
the aim of this new format is to greatly reduce the size of a resulting instrument.
|
||||
|
||||
```
|
||||
size | description
|
||||
-----|------------------------------------
|
||||
6 | "FURINS" format magic
|
||||
2 | format version
|
||||
1 | instrument type
|
||||
??? | feature bits
|
||||
4 | instrument length (if wave/sample bits are on)
|
||||
```
|
||||
|
||||
the "feature bits" field is a variable length bitfield. bit 7 in a byte indicates "read one more byte".
|
||||
|
||||
the feature bits are:
|
||||
|
||||
- 0: has wavetables
|
||||
- 1: has samples
|
||||
- 2: has name
|
||||
- 3: FM data
|
||||
- 4: FM data size (1: 2-op, 0: 4-op)
|
||||
- 5: FM data includes OPL/OPZ data
|
||||
- if off, only read an op until ssgEnv.
|
||||
- if on, read everything else.
|
||||
- 6: Game Boy data
|
||||
- 7: (continue in next byte)
|
||||
- 8: C64 data
|
||||
- 9: Amiga data
|
||||
- 10: standard data (macros)
|
||||
- 11: operator macros
|
||||
- 12: release points
|
||||
- 13: op release points
|
||||
- 14: extended op macros
|
||||
- 15: (continue in next byte)
|
||||
- 16: OPL drums mode data
|
||||
- 17: Amiga sample map data
|
||||
- 18: Namco 163 data
|
||||
- 19: extra macros
|
||||
- 20: FDS data
|
||||
- 21: OPZ data
|
||||
- 22: wavetable synth data
|
||||
- 23: (continue in next byte)
|
||||
- 24: additional macro modes
|
||||
- 25: extra C64 data
|
||||
- 26: MultiPCM data
|
Loading…
Reference in a new issue