HDD audio profile for settings, ui and using the selected profile

This commit is contained in:
Domppari
2026-01-04 08:59:43 +02:00
parent ebe651761b
commit b13e4c44b4
9 changed files with 534 additions and 71 deletions

View File

@@ -172,6 +172,7 @@ typedef struct hard_disk_t {
uint32_t hpc;
uint32_t tracks;
uint32_t speed_preset;
uint32_t audio_profile;
uint32_t num_zones;
uint32_t phy_cyl;

View File

@@ -1,6 +1,63 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Definitions for the hard disk audio emulation.
*
* Authors: Toni Riikonen, <riikonen.toni@gmail.com>
*
* Copyright 2026 Toni Riikonen.
*/
#ifndef EMU_HDD_AUDIO_H
#define EMU_HDD_AUDIO_H
#include <stdint.h>
#include <86box/hdd.h>
#ifdef __cplusplus
extern "C" {
#endif
#define HDD_AUDIO_PROFILE_MAX 64
/* Audio sample configuration structure */
typedef struct {
char filename[512];
float volume;
} hdd_audio_sample_config_t;
/* HDD audio profile configuration */
typedef struct {
int id;
char name[128];
char internal_name[64];
hdd_audio_sample_config_t spindlemotor_start;
hdd_audio_sample_config_t spindlemotor_loop;
hdd_audio_sample_config_t spindlemotor_stop;
hdd_audio_sample_config_t seek_track;
} hdd_audio_profile_config_t;
/* Functions for profile management */
extern void hdd_audio_load_profiles(void);
extern int hdd_audio_get_profile_count(void);
extern const hdd_audio_profile_config_t *hdd_audio_get_profile(int id);
extern const char *hdd_audio_get_profile_name(int id);
extern const char *hdd_audio_get_profile_internal_name(int id);
extern int hdd_audio_get_profile_by_internal_name(const char *internal_name);
/* HDD audio initialization and cleanup */
extern void hdd_audio_init(void);
extern void hdd_audio_reset(void);
extern void hdd_audio_close(void);
extern void hdd_audio_callback(int16_t *buffer, int length);
extern void hdd_audio_seek(hard_disk_t *hdd, uint32_t new_cylinder);
extern void hdd_audio_seek(hard_disk_t *hdd, uint32_t new_cylinder);
#ifdef __cplusplus
}
#endif
#endif /* EMU_HDD_AUDIO_H */