--- /dev/null
+/*
+ * Copyright (C) 2013 Team XBMC
+ * http://xbmc.org
+ *
+ * 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, 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "AudioFormat.h"
+#include "JNIBase.h"
+#include "jutils/jutils-details.hpp"
+
+using namespace jni;
+
+int CJNIAudioFormat::ENCODING_PCM_16BIT = 0x00000002;
+int CJNIAudioFormat::CHANNEL_OUT_STEREO = 0x0000000c;
+
+void CJNIAudioFormat::PopulateStaticFields()
+{
+ int sdk = CJNIBase::GetSDKVersion();
+ if (sdk >= 3)
+ {
+ jhclass c = find_class("android/media/AudioFormat");
+ CJNIAudioFormat::ENCODING_PCM_16BIT = get_static_field<int>(c, "ENCODING_PCM_16BIT");
+ if (sdk >= 5)
+ CJNIAudioFormat::CHANNEL_OUT_STEREO = get_static_field<int>(c, "CHANNEL_OUT_STEREO");
+ }
+}
+
--- /dev/null
+#pragma once
+/*
+ * Copyright (C) 2013 Team XBMC
+ * http://xbmc.org
+ *
+ * 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, 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace jni
+{
+
+class CJNIAudioFormat
+{
+ public:
+ static void PopulateStaticFields();
+
+ static int ENCODING_PCM_16BIT;
+ static int CHANNEL_OUT_STEREO;
+};
+
+};
+
#include "PowerManager.h"
#include "Cursor.h"
#include "ConnectivityManager.h"
+#include "AudioFormat.h"
#include "AudioManager.h"
#include "Surface.h"
#include "MediaCodec.h"
CJNICursor::PopulateStaticFields();
CJNIContentResolver::PopulateStaticFields();
CJNIConnectivityManager::PopulateStaticFields();
+ CJNIAudioFormat::PopulateStaticFields();
CJNIAudioManager::PopulateStaticFields();
CJNISurface::PopulateStaticFields();
CJNIMediaCodec::PopulateStaticFields();
SRCS += BroadcastReceiver.cpp
SRCS += Intent.cpp
SRCS += PackageManager.cpp
+SRCS += AudioFormat.cpp
SRCS += AudioManager.cpp
SRCS += PowerManager.cpp
SRCS += WakeLock.cpp