]> git.sesse.net Git - vlc/blobdiff - modules/audio_filter/equalizer_presets.h
demux: ts: don't try to seek on non seekable
[vlc] / modules / audio_filter / equalizer_presets.h
index 5966630cf5095efd89ce5eb16d0f869dcfa057f6..3ea70ca1cbcce82da07c8e83d74424467399ebb5 100644 (file)
@@ -1,26 +1,29 @@
 /*****************************************************************************
  * equalizer_presets.h:
  *****************************************************************************
- * Copyright (C) 2004 VideoLAN
- * $Id:$
+ * Copyright (C) 2004 VLC authors and VideoLAN
+ * $Id$
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#ifndef _EQUALIZER_PRESETS_H
+#define _EQUALIZER_PRESETS_H 1
+
 /*****************************************************************************
  * Equalizer presets
  *****************************************************************************/
 
 #define EQZ_BANDS_MAX 10
 
-static char *preset_list[] = {
+/* The frequency tables */
+static const float f_vlc_frequency_table_10b[EQZ_BANDS_MAX] =
+{
+    60, 170, 310, 600, 1000, 3000, 6000, 12000, 14000, 16000,
+};
+
+static const float f_iso_frequency_table_10b[EQZ_BANDS_MAX] =
+{
+    31.25, 62.5, 125, 250, 500, 1000, 2000, 4000, 8000, 16000,
+};
+
+#define NB_PRESETS 18
+static const char *const preset_list[NB_PRESETS] = {
     "flat", "classical", "club", "dance", "fullbass", "fullbasstreble",
     "fulltreble", "headphones","largehall", "live", "party", "pop", "reggae",
     "rock", "ska", "soft", "softrock", "techno"
 };
-static char *preset_list_text[] = {
+static const char *const preset_list_text[NB_PRESETS] = {
     N_("Flat"), N_("Classical"), N_("Club"), N_("Dance"), N_("Full bass"),
     N_("Full bass and treble"), N_("Full treble"), N_("Headphones"),
     N_("Large Hall"), N_("Live"), N_("Party"), N_("Pop"), N_("Reggae"),
@@ -44,126 +59,99 @@ static char *preset_list_text[] = {
 
 typedef struct
 {
-    char *psz_name;
+    const char psz_name[16];
     int  i_band;
     float f_preamp;
     float f_amp[EQZ_BANDS_MAX];
 } eqz_preset_t;
 
-static const eqz_preset_t eqz_preset_flat_10b=
-{
-    "flat", 10, 12.0,
-    { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 },
-};
-static const eqz_preset_t eqz_preset_classical_10b=
-{
-    "classical", 10, 12.0,
-    { -1.11022e-15, -1.11022e-15, -1.11022e-15, -1.11022e-15, -1.11022e-15, -1.11022e-15, -7.2, -7.2, -7.2, -9.6 }
-};
-static const eqz_preset_t eqz_preset_club_10b=
-{
-    "club", 10, 6.0,
-    { -1.11022e-15, -1.11022e-15, 8, 5.6, 5.6, 5.6, 3.2, -1.11022e-15, -1.11022e-15, -1.11022e-15 }
-};
-static const eqz_preset_t eqz_preset_dance_10b=
-{
-    "dance", 10, 5.0,
-    { 9.6, 7.2, 2.4, -1.11022e-15, -1.11022e-15, -5.6, -7.2, -7.2, -1.11022e-15, -1.11022e-15 }
-};
-static const eqz_preset_t eqz_preset_fullbass_10b=
-{
-    "fullbass", 10, 5.0,
-    { -8, 9.6, 9.6, 5.6, 1.6, -4, -8, -10.4, -11.2, -11.2  }
-};
-static const eqz_preset_t eqz_preset_fullbasstreble_10b=
-{
-    "fullbasstreble", 10, 4.0,
-    { 7.2, 5.6, -1.11022e-15, -7.2, -4.8, 1.6, 8, 11.2, 12, 12 }
-};
-
-static const eqz_preset_t eqz_preset_fulltreble_10b=
-{
-    "fulltreble", 10, 3.0,
-    { -9.6, -9.6, -9.6, -4, 2.4, 11.2, 16, 16, 16, 16.8 }
-};
-static const eqz_preset_t eqz_preset_headphones_10b=
-{
-    "headphones", 10, 4.0,
-    { 4.8, 11.2, 5.6, -3.2, -2.4, 1.6, 4.8, 9.6, 12.8, 14.4 }
-};
-static const eqz_preset_t eqz_preset_largehall_10b=
-{
-    "largehall", 10, 5.0,
-    { 10.4, 10.4, 5.6, 5.6, -1.11022e-15, -4.8, -4.8, -4.8, -1.11022e-15, -1.11022e-15 }
-};
-static const eqz_preset_t eqz_preset_live_10b=
-{
-    "live", 10, 7.0,
-    { -4.8, -1.11022e-15, 4, 5.6, 5.6, 5.6, 4, 2.4, 2.4, 2.4 }
-};
-static const eqz_preset_t eqz_preset_party_10b=
-{
-    "party", 10, 6.0,
-    { 7.2, 7.2, -1.11022e-15, -1.11022e-15, -1.11022e-15, -1.11022e-15, -1.11022e-15, -1.11022e-15, 7.2, 7.2 }
-};
-static const eqz_preset_t eqz_preset_pop_10b=
-{
-    "pop", 10, 6.0,
-    { -1.6, 4.8, 7.2, 8, 5.6, -1.11022e-15, -2.4, -2.4, -1.6, -1.6 }
-};
-static const eqz_preset_t eqz_preset_reggae_10b=
-{
-    "reggae", 10, 8.0,
-    { -1.11022e-15, -1.11022e-15, -1.11022e-15, -5.6, -1.11022e-15, 6.4, 6.4, -1.11022e-15, -1.11022e-15, -1.11022e-15 }
-};
-static const eqz_preset_t eqz_preset_rock_10b=
-{
-    "rock", 10, 5.0,
-    { 8, 4.8, -5.6, -8, -3.2, 4, 8.8, 11.2, 11.2, 11.2 }
-};
-static const eqz_preset_t eqz_preset_ska_10b=
-{
-    "ska", 10, 6.0,
-    { -2.4, -4.8, -4, -1.11022e-15, 4, 5.6, 8.8, 9.6, 11.2, 9.6 }
-};
-static const eqz_preset_t eqz_preset_soft_10b=
-{
-    "soft", 10, 5.0,
-    { 4.8, 1.6, -1.11022e-15, -2.4, -1.11022e-15, 4, 8, 9.6, 11.2, 12 }
-};
-static const eqz_preset_t eqz_preset_softrock_10b=
-{
-    "softrock", 10, 7.0,
-    { 4, 4, 2.4, -1.11022e-15, -4, -5.6, -3.2, -1.11022e-15, 2.4, 8.8 }
-};
-static const eqz_preset_t eqz_preset_techno_10b=
-{
-    "techno", 10, 5.0,
-    { 8, 5.6, -1.11022e-15, -5.6, -4.8, -1.11022e-15, 8, 9.6, 9.6, 8.8 }
-};
-
-static const eqz_preset_t *eqz_preset_10b[] =
-{
-    &eqz_preset_flat_10b,
-    &eqz_preset_classical_10b,
-    &eqz_preset_club_10b,
-    &eqz_preset_dance_10b,
-    &eqz_preset_fullbass_10b,
-    &eqz_preset_fullbasstreble_10b,
-    &eqz_preset_fulltreble_10b,
-    &eqz_preset_headphones_10b,
-    &eqz_preset_largehall_10b,
-    &eqz_preset_live_10b,
-    &eqz_preset_party_10b,
-    &eqz_preset_pop_10b,
-    &eqz_preset_reggae_10b,
-    &eqz_preset_rock_10b,
-    &eqz_preset_ska_10b,
-    &eqz_preset_soft_10b,
-    &eqz_preset_softrock_10b,
-    &eqz_preset_techno_10b,
-    NULL
+static const eqz_preset_t eqz_preset_10b[NB_PRESETS] =
+{
+    {
+        "flat", 10, 12.0f,
+        { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f },
+    },
+    {
+        "classical", 10, 12.0f,
+        { -1.11022e-15f, -1.11022e-15f, -1.11022e-15f, -1.11022e-15f,
+          -1.11022e-15f, -1.11022e-15f, -7.2f, -7.2f, -7.2f, -9.6f }
+    },
+    {
+        "club", 10, 6.0f,
+        { -1.11022e-15f, -1.11022e-15f, 8.0f, 5.6f, 5.6f, 5.6f, 3.2f,
+          -1.11022e-15f, -1.11022e-15f, -1.11022e-15f }
+    },
+    {
+        "dance", 10, 5.0f,
+        { 9.6f, 7.2f, 2.4f, -1.11022e-15f, -1.11022e-15f, -5.6f, -7.2f, -7.2f,
+          -1.11022e-15f, -1.11022e-15f }
+    },
+    {
+        "fullbass", 10, 5.0f,
+        { -8.0f, 9.6f, 9.6f, 5.6f, 1.6f, -4.0f, -8.0f, -10.4f, -11.2f, -11.2f }
+    },
+    {
+        "fullbasstreble", 10, 4.0f,
+        { 7.2f, 5.6f, -1.11022e-15f, -7.2f, -4.8f, 1.6f, 8.0f, 11.2f,
+          12.0f, 12.0f }
+    },
+    {
+        "fulltreble", 10, 3.0f,
+        { -9.6f, -9.6f, -9.6f, -4.0f, 2.4f, 11.2f, 16.0f, 16.0f, 16.0f, 16.8f }
+    },
+    {
+        "headphones", 10, 4.0f,
+        { 4.8f, 11.2f, 5.6f, -3.2f, -2.4f, 1.6f, 4.8f, 9.6f, 12.8f, 14.4f }
+    },
+    {
+        "largehall", 10, 5.0f,
+        { 10.4f, 10.4f, 5.6f, 5.6f, -1.11022e-15f, -4.8f, -4.8f, -4.8f,
+          -1.11022e-15f, -1.11022e-15f }
+    },
+    {
+        "live", 10, 7.0f,
+        { -4.8f, -1.11022e-15f, 4.0f, 5.6f, 5.6f, 5.6f, 4.0f, 2.4f,
+          2.4f, 2.4f }
+    },
+    {
+        "party", 10, 6.0f,
+        { 7.2f, 7.2f, -1.11022e-15f, -1.11022e-15f, -1.11022e-15f,
+          -1.11022e-15f, -1.11022e-15f, -1.11022e-15f, 7.2f, 7.2f }
+    },
+    {
+        "pop", 10, 6.0f,
+        { -1.6f, 4.8f, 7.2f, 8.0f, 5.6f, -1.11022e-15f, -2.4f, -2.4f,
+          -1.6f, -1.6f }
+    },
+    {
+        "reggae", 10, 8.0f,
+        { -1.11022e-15f, -1.11022e-15f, -1.11022e-15f, -5.6f, -1.11022e-15f,
+          6.4f, 6.4f, -1.11022e-15f, -1.11022e-15f, -1.11022e-15f }
+    },
+    {
+        "rock", 10, 5.0f,
+        { 8.0f, 4.8f, -5.6f, -8.0f, -3.2f, 4.0f, 8.8f, 11.2f, 11.2f, 11.2f }
+    },
+    {
+        "ska", 10, 6.0f,
+        { -2.4f, -4.8f, -4.0f, -1.11022e-15f, 4.0f, 5.6f, 8.8f, 9.6f,
+          11.2f, 9.6f }
+    },
+    {
+        "soft", 10, 5.0f,
+        { 4.8f, 1.6f, -1.11022e-15f, -2.4f, -1.11022e-15f, 4.0f, 8.0f, 9.6f,
+          11.2f, 12.0f }
+    },
+    {
+        "softrock", 10, 7.0f,
+        { 4.0f, 4.0f, 2.4f, -1.11022e-15f, -4.0f, -5.6f, -3.2f, -1.11022e-15f,
+          2.4f, 8.8f }
+    },
+    {
+        "techno", 10, 5.0f,
+        { 8.0f, 5.6f, -1.11022e-15f, -5.6f, -4.8f, -1.11022e-15f, 8.0f, 9.6f,
+          9.6f, 8.8f }
+    },
 };
 
-
-
+#endif