Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Magic Lantern sound recorder patch
--- a/src/all_features.h Thu Aug 07 00:44:10 2014 +0300
+++ b/src/all_features.h Wed Aug 06 21:10:33 2014 -0400
@@ -40,8 +40,10 @@
#ifdef CONFIG_BEEP
#define FEATURE_BEEP
#endif
- //~ #define FEATURE_WAV_RECORDING
- //~ #define FEATURE_VOICE_TAGS
+
+/* Reenable this - @jbuchbinder */
+#define FEATURE_WAV_RECORDING
+#define FEATURE_VOICE_TAGS
/** Expo menu **/
@@ -126,7 +128,9 @@
#define FEATURE_FPS_OVERRIDE
#define FEATURE_FPS_RAMPING
- //~ #define FEATURE_FPS_WAV_RECORD
+
+/* Reenable this - @jbuchbinder */
+#define FEATURE_FPS_WAV_RECORD
#ifdef CONFIG_FRAME_ISO_OVERRIDE
#define FEATURE_HDR_VIDEO
diff -r d16f5042f909 src/beep.c
--- a/src/beep.c Thu Aug 07 00:44:10 2014 +0300
+++ b/src/beep.c Wed Aug 06 21:10:33 2014 -0400
@@ -8,19 +8,23 @@
#include "cache_hacks.h"
extern int gui_state;
-extern int file_number;
int beep_playing = 0;
#ifdef CONFIG_BEEP
/* ASIF interface (private) */
-extern void StartASIFDMADAC(void* buf1, int N1, int buf2, int N2, void (*continue_cbr)(void*), void* cbr_arg_maybe);
+extern void StartASIFDMADAC(void* buf1, int N1, void *buf2, int N2, void (*continue_cbr)(void*), void* cbr_arg_maybe);
extern void StopASIFDMADAC(void (*stop_cbr)(void*), int cbr_arg_maybe);
extern void SetSamplingRate(int sample_rate, int unknown);
extern void PowerAudioOutput();
extern void SetAudioVolumeOut(int volume);
+extern void StartASIFDMAADC(void* buf1, int N1, uint8_t* buf2, int N2, void (*continue_cbr)(void*), int N3);
+extern void StopASIFDMAADC(void (*stop_cbr)(void*), int cbr_arg_maybe);
+extern void SetNextASIFADCBuffer(void* buf1, int N1);
+extern void SetNextASIFDACBuffer(void* buf1, int N1);
+
#define BEEP_LONG -1
#define BEEP_SHORT 0
#define BEEP_WAV -2
@@ -476,7 +480,7 @@
#if defined(CONFIG_7D) || defined(CONFIG_6D) || defined(CONFIG_EOSM)
/* experimental for 7D now, has to be made generic */
/* Enable audio Device */
- void SoundDevActiveIn (uint32_t);
+ int SoundDevActiveIn (uint32_t);
SoundDevActiveIn(0);
#endif
@@ -966,7 +970,7 @@
if (QR_MODE)
{
char filename[100];
- snprintf(filename, sizeof(filename), "%s/IMG_%04d.WAV", get_dcim_dir(), file_number);
+ snprintf(filename, sizeof(filename), "%s/IMG_%04d.WAV", get_dcim_dir(), get_shooting_card()->file_number);
record_start(filename,0);
return 0;
}
@@ -978,12 +982,12 @@
#ifdef FEATURE_WAV_RECORDING
PROP_HANDLER( PROP_MVR_REC_START )
{
- if (!fps_should_record_wav() && !hibr_should_record_wav()) return;
+ if (!fps_should_record_wav() /* && !hibr_should_record_wav() */) return;
int rec = buf[0];
if (rec == 1)
{
char filename[100];
- snprintf(filename, sizeof(filename), "%s/MVI_%04d.WAV", get_dcim_dir(), file_number);
+ snprintf(filename, sizeof(filename), "%s/MVI_%04d.WAV", get_dcim_dir(), get_shooting_card()->file_number);
record_start(filename,0);
}
else if (rec == 0) audio_stop_recording();
diff -r d16f5042f909 src/fps-engio.c
--- a/src/fps-engio.c Thu Aug 07 00:44:10 2014 +0300
+++ b/src/fps-engio.c Wed Aug 06 21:10:33 2014 -0400
@@ -172,6 +172,11 @@
#define FPS_RAMP (fps_ramp && is_movie_mode())
+/* HACK! - @jbuchbinder */
+#ifndef FPS_SOUND_DISABLE
+#define FPS_SOUND_DISABLE 1
+#endif /* FPS_SOUND_DISABLE */
+
#ifdef FEATURE_FPS_WAV_RECORD
#ifndef FEATURE_FPS_OVERRIDE
#error This requires FEATURE_FPS_OVERRIDE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment