move "cocos2d::experimental::" to "cocos2d::" on Audio (#1549)

* remove “experimental” in audio dir

* update audio bindings

* fix "{" match error

* no need "experimental" for thread pool

* remove both out-of-date js api files
This commit is contained in:
leda
2018-10-18 13:34:12 +08:00
committed by GitHub
parent d432a9643e
commit dada2eb244
84 changed files with 232 additions and 707 deletions
-1
View File
@@ -55,7 +55,6 @@
#endif // ERROR
using namespace cocos2d;
using namespace cocos2d::experimental;
const int AudioEngine::INVALID_AUDIO_ID = -1;
const float AudioEngine::TIME_UNKNOWN = -1.0f;
+2 -2
View File
@@ -28,7 +28,7 @@ THE SOFTWARE.
#include "audio/android/cutils/log.h"
#include "audio/android/AssetFd.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
AssetFd::AssetFd(int assetFd)
: _assetFd(assetFd)
@@ -45,4 +45,4 @@ AssetFd::~AssetFd()
}
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -26,7 +26,7 @@ THE SOFTWARE.
#include <unistd.h>
namespace cocos2d { namespace experimental {
namespace cocos2d {
class AssetFd
{
@@ -39,5 +39,5 @@ private:
int _assetFd;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -20,7 +20,7 @@
#include <stdint.h>
#include "audio/android/utils/Errors.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
// ----------------------------------------------------------------------------
class AudioBufferProvider
@@ -77,4 +77,4 @@ public:
};
// ----------------------------------------------------------------------------
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -33,7 +33,7 @@ THE SOFTWARE.
#include <thread>
#include <chrono>
namespace cocos2d { namespace experimental {
namespace cocos2d {
size_t AudioDecoder::fileRead(void* ptr, size_t size, size_t nmemb, void* datasource)
{
@@ -290,4 +290,4 @@ bool AudioDecoder::interleave()
return false;
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -29,7 +29,7 @@ THE SOFTWARE.
#include "audio/android/PcmData.h"
#include "base/CCData.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
class AudioDecoder
{
@@ -61,4 +61,4 @@ protected:
size_t _fileCurrPos;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -29,7 +29,7 @@ THE SOFTWARE.
#include "audio/android/mp3reader.h"
#include "platform/CCFileUtils.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
AudioDecoderMp3::AudioDecoderMp3()
{
@@ -80,4 +80,4 @@ bool AudioDecoderMp3::decodeToPcm()
return false;
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -27,7 +27,7 @@ THE SOFTWARE.
#include "audio/android/AudioDecoder.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
class AudioDecoderMp3 : public AudioDecoder
{
@@ -40,4 +40,4 @@ protected:
friend class AudioDecoderProvider;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -28,7 +28,7 @@ THE SOFTWARE.
#include "audio/android/AudioDecoderOgg.h"
#include "platform/CCFileUtils.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
AudioDecoderOgg::AudioDecoderOgg()
{
@@ -110,4 +110,4 @@ bool AudioDecoderOgg::decodeToPcm()
return (curPos > 0);
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -29,7 +29,7 @@ THE SOFTWARE.
#include "tremolo/Tremolo/ivorbisfile.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
class AudioDecoderOgg : public AudioDecoder
{
@@ -43,4 +43,4 @@ protected:
friend class AudioDecoderProvider;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -32,7 +32,7 @@
#include "audio/android/AudioDecoderWav.h"
#include "platform/CCFileUtils.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
AudioDecoder* AudioDecoderProvider::createAudioDecoder(SLEngineItf engineItf, const std::string &url, int bufferSizeInFrames, int sampleRate, const FdGetterCallback &fdGetterCallback)
{
@@ -91,4 +91,4 @@ void AudioDecoderProvider::destroyAudioDecoder(AudioDecoder** decoder)
}
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -27,7 +27,7 @@ THE SOFTWARE.
#include "audio/android/OpenSLHelper.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
class AudioDecoder;
@@ -38,4 +38,4 @@ public:
static void destroyAudioDecoder(AudioDecoder** decoder);
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -31,7 +31,7 @@ THE SOFTWARE.
#include <thread>
#include <mutex>
namespace cocos2d { namespace experimental {
namespace cocos2d {
/* Explicitly requesting SL_IID_ANDROIDSIMPLEBUFFERQUEUE and SL_IID_PREFETCHSTATUS
* on the UrlAudioPlayer object for decoding, SL_IID_METADATAEXTRACTION for retrieving the
@@ -646,4 +646,4 @@ void AudioDecoderSLES::decodeToPcmCallback(SLAndroidSimpleBufferQueueItf queueIt
queryAudioInfo();
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -29,7 +29,7 @@ THE SOFTWARE.
#include <mutex>
#include <condition_variable>
namespace cocos2d { namespace experimental {
namespace cocos2d {
class AudioDecoderSLES : public AudioDecoder
{
@@ -94,4 +94,4 @@ private:
friend class AudioDecoderProvider;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -31,7 +31,7 @@ THE SOFTWARE.
#include <assert.h>
namespace cocos2d { namespace experimental {
namespace cocos2d {
AudioDecoderWav::AudioDecoderWav()
{
@@ -112,4 +112,4 @@ bool AudioDecoderWav::decodeToPcm()
return ret;
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -27,7 +27,7 @@ THE SOFTWARE.
#include "audio/android/AudioDecoder.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
class AudioDecoderWav : public AudioDecoder
{
@@ -44,4 +44,4 @@ protected:
friend class AudioDecoderProvider;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -56,7 +56,6 @@
#include "scripting/js-bindings/event/CustomEventTypes.h"
using namespace cocos2d;
using namespace cocos2d::experimental;
// Audio focus values synchronized with which in cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java
static const int AUDIOFOCUS_GAIN = 0;
@@ -44,8 +44,6 @@ NS_CC_BEGIN
struct CustomEvent;
namespace experimental {
class IAudioPlayer;
class AudioPlayerProvider;
@@ -104,7 +102,6 @@ private:
};
#endif // __AUDIO_ENGINE_INL_H_
}
NS_CC_END
#endif
+2 -2
View File
@@ -73,7 +73,7 @@ static const bool kUseFloat = false;
// Set to default copy buffer size in frames for input processing.
static const size_t kCopyBufferFrameCount = 256;
namespace cocos2d { namespace experimental {
namespace cocos2d {
// ----------------------------------------------------------------------------
@@ -2098,4 +2098,4 @@ AudioMixer::process_hook_t AudioMixer::getProcessHook(int processType, uint32_t
}
// ----------------------------------------------------------------------------
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -30,7 +30,7 @@
// IDEA: This is actually unity gain, which might not be max in future, expressed in U.12
#define MAX_GAIN_INT AudioMixer::UNITY_GAIN_INT
namespace cocos2d { namespace experimental {
namespace cocos2d {
// ----------------------------------------------------------------------------
@@ -386,4 +386,4 @@ private:
};
// ----------------------------------------------------------------------------
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -32,7 +32,7 @@ THE SOFTWARE.
#include <algorithm>
namespace cocos2d { namespace experimental {
namespace cocos2d {
AudioMixerController::AudioMixerController(int bufferSizeInFrames, int sampleRate, int channelCount)
: _bufferSizeInFrames(bufferSizeInFrames)
@@ -347,4 +347,4 @@ bool AudioMixerController::hasPlayingTacks()
return false;
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -33,7 +33,7 @@ THE SOFTWARE.
#include <atomic>
#include <vector>
namespace cocos2d { namespace experimental {
namespace cocos2d {
class Track;
class AudioMixer;
@@ -85,4 +85,4 @@ private:
std::atomic_bool _isMixingFrame;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -18,7 +18,7 @@
#include "audio/android/cutils/log.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
/* Behavior of is_same<>::value is true if the types are identical,
* false otherwise. Identical to the STL std::is_same.
@@ -446,5 +446,5 @@ inline void volumeMulti(TO* out, size_t frameCount,
}
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -40,7 +40,7 @@ THE SOFTWARE.
#include <stdlib.h>
#include <algorithm> // for std::find_if
namespace cocos2d { namespace experimental {
namespace cocos2d {
static int getSystemAPILevel()
{
@@ -516,4 +516,4 @@ void AudioPlayerProvider::resume()
}
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -33,7 +33,7 @@ THE SOFTWARE.
#include <memory>
#include <condition_variable>
namespace cocos2d { namespace experimental {
namespace cocos2d {
// Manage PcmAudioPlayer& UrlAudioPlayer
class PcmAudioPlayer;
@@ -124,5 +124,5 @@ private:
ThreadPool* _threadPool;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -39,7 +39,7 @@
namespace cocos2d { namespace experimental {
namespace cocos2d {
// ----------------------------------------------------------------------------
@@ -785,4 +785,4 @@ void AudioResamplerOrder1::AsmStereo16Loop(int16_t *in, int32_t* maxOutPt, int32
// ----------------------------------------------------------------------------
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -31,7 +31,7 @@
#include <assert.h>
#include "audio/android/audio.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
class AudioResampler {
@@ -178,4 +178,4 @@ private:
};
// ----------------------------------------------------------------------------
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -24,7 +24,7 @@
#include "audio/android/AudioResampler.h"
#include "audio/android/AudioResamplerCubic.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
// ----------------------------------------------------------------------------
void AudioResamplerCubic::init() {
@@ -188,4 +188,4 @@ save_state:
}
// ----------------------------------------------------------------------------
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -22,7 +22,7 @@
#include "audio/android/AudioResampler.h"
#include "audio/android/AudioBufferProvider.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
// ----------------------------------------------------------------------------
class AudioResamplerCubic : public AudioResampler {
@@ -62,4 +62,4 @@ private:
};
// ----------------------------------------------------------------------------
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -19,7 +19,7 @@
#include <stdint.h>
#include <math.h>
namespace cocos2d { namespace experimental {
namespace cocos2d {
// AUDIO_RESAMPLER_DOWN_RATIO_MAX is the maximum ratio between the original
// audio sample rate and the target rate when downsampling,
@@ -169,6 +169,6 @@ static inline bool isMusicRate(uint32_t sampleRate) {
return sampleRate >= AUDIO_PROCESSING_MUSIC_RATE;
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
// ---------------------------------------------------------------------------
+2 -2
View File
@@ -27,7 +27,7 @@ THE SOFTWARE.
#include <functional>
namespace cocos2d { namespace experimental {
namespace cocos2d {
class IAudioPlayer
{
@@ -86,4 +86,4 @@ public:
virtual void setPlayEventCallback(const PlayEventCallback &playEventCallback) = 0;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -27,7 +27,7 @@ THE SOFTWARE.
#include <functional>
#include <thread>
namespace cocos2d { namespace experimental {
namespace cocos2d {
class ICallerThreadUtils
{
@@ -39,4 +39,4 @@ public:
virtual std::thread::id getCallerThreadId() = 0;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -26,7 +26,7 @@ THE SOFTWARE.
#include "audio/android/audio_utils/include/audio_utils/minifloat.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
class IVolumeProvider
{
@@ -42,4 +42,4 @@ protected:
{ }
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -30,7 +30,7 @@ THE SOFTWARE.
#include "audio/android/AudioMixerController.h"
#include "audio/android/ICallerThreadUtils.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
PcmAudioPlayer::PcmAudioPlayer(AudioMixerController * controller, ICallerThreadUtils* callerThreadUtils)
: _id(-1)
@@ -223,4 +223,4 @@ IAudioPlayer::State PcmAudioPlayer::getState() const
return state;
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -29,7 +29,7 @@ THE SOFTWARE.
#include "audio/android/PcmData.h"
#include "audio/android/Track.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
class ICallerThreadUtils;
class AudioMixerController;
@@ -95,4 +95,4 @@ private:
friend class AudioPlayerProvider;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -28,7 +28,7 @@ THE SOFTWARE.
#include "audio/android/PcmAudioService.h"
#include "audio/android/AudioMixerController.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
static std::vector<char> __silenceData;
@@ -190,4 +190,4 @@ void PcmAudioService::resume()
SL_RETURN_IF_FAILED(r, "PcmAudioService::resume failed");
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -32,7 +32,7 @@ THE SOFTWARE.
#include <mutex>
#include <condition_variable>
namespace cocos2d { namespace experimental {
namespace cocos2d {
class AudioMixerController;
@@ -78,4 +78,4 @@ private:
friend class AudioPlayerProvider;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -35,7 +35,7 @@ THE SOFTWARE.
#define ALOGVV(a...) do { } while (0)
#endif
namespace cocos2d { namespace experimental {
namespace cocos2d {
PcmBufferProvider::PcmBufferProvider()
: _addr(nullptr)
@@ -99,4 +99,4 @@ void PcmBufferProvider::reset() {
_nextFrame = 0;
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -30,7 +30,7 @@ THE SOFTWARE.
#include <stddef.h>
#include <stdio.h>
namespace cocos2d { namespace experimental {
namespace cocos2d {
class PcmBufferProvider : public AudioBufferProvider
{
@@ -49,4 +49,4 @@ protected:
size_t _unrel; // number of frames not yet released
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -28,7 +28,7 @@ THE SOFTWARE.
#include "audio/android/OpenSLHelper.h"
#include "audio/android/PcmData.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
PcmData::PcmData()
{
@@ -136,4 +136,4 @@ std::string PcmData::toString() const
return ret;
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -30,7 +30,7 @@ THE SOFTWARE.
#include <vector>
#include <memory>
namespace cocos2d { namespace experimental {
namespace cocos2d {
struct PcmData
{
@@ -63,4 +63,4 @@ struct PcmData
std::string toString() const;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -30,7 +30,7 @@ THE SOFTWARE.
#include <math.h>
namespace cocos2d { namespace experimental {
namespace cocos2d {
Track::Track(const PcmData &pcmData)
: onStateChanged(nullptr)
@@ -103,4 +103,4 @@ void Track::setState(State state)
}
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -32,7 +32,7 @@ THE SOFTWARE.
#include <functional>
#include <mutex>
namespace cocos2d { namespace experimental {
namespace cocos2d {
class Track : public PcmBufferProvider, public IVolumeProvider
{
@@ -104,4 +104,4 @@ private:
friend class AudioMixerController;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -34,12 +34,12 @@ THE SOFTWARE.
namespace {
std::mutex __playerContainerMutex;
std::vector<cocos2d::experimental::UrlAudioPlayer*> __playerContainer;
std::vector<cocos2d::UrlAudioPlayer*> __playerContainer;
std::once_flag __onceFlag;
}
namespace cocos2d { namespace experimental {
namespace cocos2d {
class SLUrlAudioPlayerCallbackProxy
{
@@ -421,4 +421,4 @@ void UrlAudioPlayer::destroy()
}
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -33,7 +33,7 @@ THE SOFTWARE.
#include <memory>
#include <thread>
namespace cocos2d { namespace experimental {
namespace cocos2d {
class ICallerThreadUtils;
class AssetFd;
@@ -132,4 +132,4 @@ private:
friend class AudioPlayerProvider;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -20,7 +20,7 @@
#include <sys/types.h>
#include <errno.h>
namespace cocos2d { namespace experimental {
namespace cocos2d {
// use this type to return error codes
#ifdef _WIN32
@@ -81,7 +81,7 @@ enum {
# define NO_ERROR 0L
#endif
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
// ---------------------------------------------------------------------------
+2 -2
View File
@@ -29,11 +29,11 @@ THE SOFTWARE.
#define JCLS_HELPER "org/cocos2dx/lib/Cocos2dxHelper"
#endif
namespace cocos2d { namespace experimental {
namespace cocos2d {
int getSDKVersion()
{
return JniHelper::callStaticIntMethod(JCLS_HELPER, "getSDKVersion");
}
}} // end of namespace cocos2d { namespace experimental
} // end of namespace cocos2d
+2 -2
View File
@@ -25,6 +25,6 @@ THE SOFTWARE.
#include <string>
namespace cocos2d { namespace experimental {
namespace cocos2d {
extern int getSDKVersion();
}}
}
-3
View File
@@ -38,8 +38,6 @@
#include "audio/apple/AudioMacros.h"
NS_CC_BEGIN
namespace experimental{
class AudioEngineImpl;
class AudioPlayer;
@@ -110,7 +108,6 @@ protected:
friend class AudioPlayer;
};
}
NS_CC_END
#endif
-1
View File
@@ -110,7 +110,6 @@ static void setTimeout(double seconds, const std::function<void()>& cb)
}
using namespace cocos2d;
using namespace cocos2d::experimental;
AudioCache::AudioCache()
: _format(-1)
+2 -2
View File
@@ -28,7 +28,7 @@
#include <stdint.h>
#import <AudioToolbox/ExtendedAudioFile.h>
namespace cocos2d { namespace experimental {
namespace cocos2d {
/**
* @brief The class for decoding compressed audio file to PCM buffer.
@@ -117,4 +117,4 @@ private:
AudioStreamBasicDescription _outputFormat;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -30,7 +30,7 @@
#define LOG_TAG "AudioDecoder"
namespace cocos2d { namespace experimental {
namespace cocos2d {
AudioDecoder::AudioDecoder()
: _isOpened(false)
@@ -226,4 +226,4 @@ namespace cocos2d { namespace experimental {
return _isOpened;
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -38,7 +38,6 @@
NS_CC_BEGIN
class Scheduler;
namespace experimental{
#define MAX_AUDIOINSTANCES 24
class AudioEngineImpl : public cocos2d::Ref
@@ -88,7 +87,6 @@ private:
int _currentAudioID;
Scheduler* _scheduler;
};
}
NS_CC_END
#endif // __AUDIO_ENGINE_INL_H_
#endif
@@ -40,7 +40,6 @@
#include "base/ccUtils.h"
using namespace cocos2d;
using namespace cocos2d::experimental;
static ALCdevice* s_ALDevice = nullptr;
static ALCcontext* s_ALContext = nullptr;
-3
View File
@@ -38,8 +38,6 @@
#include <OpenAL/al.h>
NS_CC_BEGIN
namespace experimental{
class AudioCache;
class AudioEngineImpl;
@@ -91,7 +89,6 @@ protected:
friend class AudioEngineImpl;
};
}
NS_CC_END
#endif
-1
View File
@@ -42,7 +42,6 @@
#endif
using namespace cocos2d;
using namespace cocos2d::experimental;
namespace {
unsigned int __idIndex = 0;
-3
View File
@@ -44,8 +44,6 @@
*/
NS_CC_BEGIN
namespace experimental {
/**
* @class AudioProfile
*
@@ -369,7 +367,6 @@ protected:
friend class AudioEngineImpl;
};
} // namespace experimental {
NS_CC_END
// end group
-1
View File
@@ -52,7 +52,6 @@ unsigned int __idIndex = 0;
#define PCMDATA_CACHEMAXSIZE 1048576
using namespace cocos2d;
using namespace cocos2d::experimental;
AudioCache::AudioCache()
: _totalFrames(0)
-3
View File
@@ -42,8 +42,6 @@
#include "audio/win32/AudioMacros.h"
NS_CC_BEGIN
namespace experimental{
class AudioEngineImpl;
class AudioPlayer;
@@ -114,7 +112,6 @@ protected:
friend class AudioPlayer;
};
}
NS_CC_END
#endif
+2 -2
View File
@@ -29,7 +29,7 @@
#define LOG_TAG "AudioDecoder"
namespace cocos2d { namespace experimental {
namespace cocos2d {
AudioDecoder::AudioDecoder()
: _isOpened(false)
@@ -89,4 +89,4 @@ AudioDecoder::AudioDecoder()
return _channelCount;
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -29,7 +29,7 @@
#include "vorbis/vorbisfile.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
/**
* @brief The class for decoding compressed audio file to PCM buffer.
@@ -117,4 +117,4 @@ protected:
friend class AudioDecoderManager;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -32,7 +32,7 @@ THE SOFTWARE.
#include "platform/CCFileUtils.h"
#include "mpg123/mpg123.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
static bool __mp3Inited = false;
@@ -66,5 +66,5 @@ void AudioDecoderManager::destroyDecoder(AudioDecoder* decoder)
delete decoder;
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -25,7 +25,7 @@ THE SOFTWARE.
#pragma once
namespace cocos2d { namespace experimental {
namespace cocos2d {
class AudioDecoder;
@@ -38,5 +38,5 @@ public:
static void destroyDecoder(AudioDecoder* decoder);
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -31,7 +31,7 @@
#define LOG_TAG "AudioDecoderMp3"
namespace cocos2d { namespace experimental {
namespace cocos2d {
static bool __mp3Inited = false;
@@ -180,4 +180,4 @@ namespace cocos2d { namespace experimental {
return static_cast<uint32_t>(mpg123_tell(_mpg123handle));
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -29,7 +29,7 @@
struct mpg123_handle_struct;
namespace cocos2d { namespace experimental {
namespace cocos2d {
/**
* @brief The class for decoding compressed audio file to PCM buffer.
@@ -83,4 +83,4 @@ protected:
friend class AudioDecoderManager;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -29,7 +29,7 @@
#define LOG_TAG "AudioDecoderOgg"
namespace cocos2d { namespace experimental {
namespace cocos2d {
AudioDecoderOgg::AudioDecoderOgg()
{
@@ -84,4 +84,4 @@ namespace cocos2d { namespace experimental {
return static_cast<uint32_t>(ov_pcm_tell(const_cast<OggVorbis_File*>(&_vf)));
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -29,7 +29,7 @@
#include "vorbis/vorbisfile.h"
namespace cocos2d { namespace experimental {
namespace cocos2d {
/**
* @brief The class for decoding compressed audio file to PCM buffer.
@@ -79,4 +79,4 @@ protected:
friend class AudioDecoderManager;
};
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -105,7 +105,6 @@ void audioLog(const char * format, ...)
}
using namespace cocos2d;
using namespace cocos2d::experimental;
static ALCdevice *s_ALDevice = nullptr;
static ALCcontext *s_ALContext = nullptr;
@@ -39,7 +39,6 @@ NS_CC_BEGIN
class Scheduler;
namespace experimental {
#define MAX_AUDIOINSTANCES 32
class CC_DLL AudioEngineImpl : public cocos2d::Ref
@@ -86,7 +85,6 @@ private:
int _currentAudioID;
Scheduler* _scheduler;
};
}
NS_CC_END
#endif // __AUDIO_ENGINE_INL_H_
#endif
-1
View File
@@ -42,7 +42,6 @@
#endif
using namespace cocos2d;
using namespace cocos2d::experimental;
namespace {
unsigned int __idIndex = 0;
-2
View File
@@ -41,7 +41,6 @@
#include "base/ccMacros.h"
NS_CC_BEGIN
namespace experimental{
class AudioCache;
class AudioEngineImpl;
@@ -92,7 +91,6 @@ protected:
friend class AudioEngineImpl;
};
}
NS_CC_END
#endif //CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
+2 -2
View File
@@ -36,7 +36,7 @@
#define LOGD(...) printf(__VA_ARGS__)
#endif
namespace cocos2d { namespace experimental {
namespace cocos2d {
#define DEFAULT_THREAD_POOL_MIN_NUM (4)
#define DEFAULT_THREAD_POOL_MAX_NUM (20)
@@ -438,4 +438,4 @@ void ThreadPool::setThread(int tid)
new(std::nothrow) std::thread(f)); // compiler may not support std::make_unique()
}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
+2 -2
View File
@@ -39,7 +39,7 @@
#include <vector>
#include <atomic>
namespace cocos2d { namespace experimental {
namespace cocos2d {
/**
* @addtogroup base
@@ -235,4 +235,4 @@ private:
// end of base group
/// @}
}} // namespace cocos2d { namespace experimental {
} // namespace cocos2d {
@@ -34,13 +34,13 @@ THE SOFTWARE.
#include "scripting/js-bindings/jswrapper/SeApi.h"
#include "scripting/js-bindings/event/EventDispatcher.h"
#define LOG_TAG "CCApplication_android Debug"
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)
#define LOG_APP_TAG "CCApplication_android Debug"
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_APP_TAG,__VA_ARGS__)
// IDEA: using ndk-r10c will cause the next function could not be found. It may be a bug of ndk-r10c.
// Here is the workaround method to fix the problem.
#ifdef __aarch64__
extern "C" size_t __ctype_get_mb_cur_max(void)
extern "C" size_t __ctype_get_mb_cur_max(void)
{
return (size_t) sizeof(wchar_t);
}
@@ -77,9 +77,9 @@ Application::~Application()
_renderTexture = nullptr;
#if USE_AUDIO // close audio device
cocos2d::experimental::AudioEngine::end();
AudioEngine::end();
#endif
Application::_instance = nullptr;
}
@@ -119,7 +119,7 @@ void Application::applicationWillEnterForeground()
}
void Application::setPreferredFramesPerSecond(int fps)
void Application::setPreferredFramesPerSecond(int fps)
{
_fps = fps;
setPreferredFramesPerSecondJNI(_fps);
@@ -228,9 +228,6 @@ Application::~Application()
EventDispatcher::destroy();
se::ScriptEngine::destroyInstance();
// close audio device
cocos2d::experimental::AudioEngine::end();
// stop main loop
[(MainLoop*)_delegate stopMainLoop];
@@ -240,6 +237,10 @@ Application::~Application()
delete _renderTexture;
_renderTexture = nullptr;
#if USE_AUDIO // close audio device
AudioEngine::end();
#endif
Application::_instance = nullptr;
}
@@ -85,9 +85,6 @@ Application::~Application()
{
EventDispatcher::destroy();
se::ScriptEngine::destroyInstance();
// close audio device
cocos2d::experimental::AudioEngine::end();
delete CAST_VIEW(_view);
_view = nullptr;
@@ -95,6 +92,10 @@ Application::~Application()
delete _renderTexture;
_renderTexture = nullptr;
#if USE_AUDIO // close audio device
AudioEngine::end();
#endif
Application::_instance = nullptr;
}
@@ -120,16 +120,16 @@ Application::~Application()
EventDispatcher::destroy();
se::ScriptEngine::destroyInstance();
//close audio device
cocos2d::experimental::AudioEngine::end();
delete CAST_VIEW(_view);
_view = nullptr;
delete _renderTexture;
_renderTexture = nullptr;
#if USE_AUDIO // close audio device
AudioEngine::end();
#endif
Application::_instance = nullptr;
}
@@ -215,7 +215,7 @@ bool
* @param {String} arg0
* @param {bool} arg1
* @param {float} arg2
* @param {cc.experimental::AudioProfile} arg3
* @param {cc.AudioProfile} arg3
* @return {int}
*/
play2d : function (
@@ -231,7 +231,7 @@ audioprofile
/**
* @method getState
* @param {int} arg0
* @return {cc.experimental::AudioEngine::AudioState}
* @return {cc.AudioEngine::AudioState}
*/
getState : function (
int
@@ -286,12 +286,12 @@ bool
/**
* @method getDefaultProfile
* @return {cc.experimental::AudioProfile}
* @return {cc.AudioProfile}
*/
getDefaultProfile : function (
)
{
return cc.experimental::AudioProfile;
return cc.AudioProfile;
},
/**
@@ -309,13 +309,13 @@ func
/**
* @method getProfile
* @param {String|int} str
* @return {cc.experimental::AudioProfile|cc.experimental::AudioProfile}
* @return {cc.AudioProfile|cc.AudioProfile}
*/
getProfile : function(
int
)
{
return cc.experimental::AudioProfile;
return cc.AudioProfile;
},
/**
@@ -1,196 +0,0 @@
/**
* @module cocos2dx_experimental_video
*/
var ccui = ccui || {};
/**
* @class VideoPlayer
*/
ccui.VideoPlayer = {
/**
* @method getFileName
* @return {String}
*/
getFileName : function (
)
{
return ;
},
/**
* @method getURL
* @return {String}
*/
getURL : function (
)
{
return ;
},
/**
* @method play
*/
play : function (
)
{
},
/**
* @method setKeepAspectRatioEnabled
* @param {bool} arg0
*/
setKeepAspectRatioEnabled : function (
bool
)
{
},
/**
* @method currentTime
* @return {float}
*/
currentTime : function (
)
{
return 0;
},
/**
* @method stop
*/
stop : function (
)
{
},
/**
* @method setFullScreenEnabled
* @param {bool} arg0
*/
setFullScreenEnabled : function (
bool
)
{
},
/**
* @method setFileName
* @param {String} arg0
*/
setFileName : function (
str
)
{
},
/**
* @method setURL
* @param {String} arg0
*/
setURL : function (
str
)
{
},
/**
* @method isKeepAspectRatioEnabled
* @return {bool}
*/
isKeepAspectRatioEnabled : function (
)
{
return false;
},
/**
* @method onPlayEvent
* @param {int} arg0
*/
onPlayEvent : function (
int
)
{
},
/**
* @method isFullScreenEnabled
* @return {bool}
*/
isFullScreenEnabled : function (
)
{
return false;
},
/**
* @method addEventListener
* @param {function} arg0
*/
addEventListener : function (
func
)
{
},
/**
* @method duration
* @return {float}
*/
duration : function (
)
{
return 0;
},
/**
* @method isPlaying
* @return {bool}
*/
isPlaying : function (
)
{
return false;
},
/**
* @method seekTo
* @param {float} arg0
*/
seekTo : function (
float
)
{
},
/**
* @method setVolume
* @param {float} arg0
*/
setVolume : function (
float
)
{
},
/**
* @method create
* @return {cc.experimental::ui::VideoPlayer}
*/
create : function (
)
{
return cc.experimental::ui::VideoPlayer;
},
/**
* @method VideoPlayer
* @constructor
*/
VideoPlayer : function (
)
{
},
};
@@ -1,250 +0,0 @@
/**
* @module cocos2dx_experimental_webView
*/
var ccui = ccui || {};
/**
* @class WebView
*/
ccui.WebView = {
/**
* @method setOnShouldStartLoading
* @param {function} arg0
*/
setOnShouldStartLoading : function (
func
)
{
},
/**
* @method setOnDidFailLoading
* @param {function} arg0
*/
setOnDidFailLoading : function (
func
)
{
},
/**
* @method canGoBack
* @return {bool}
*/
canGoBack : function (
)
{
return false;
},
/**
* @method loadHTMLString
* @param {String} arg0
* @param {String} arg1
*/
loadHTMLString : function (
str,
str
)
{
},
/**
* @method goForward
*/
goForward : function (
)
{
},
/**
* @method goBack
*/
goBack : function (
)
{
},
/**
* @method setScalesPageToFit
* @param {bool} arg0
*/
setScalesPageToFit : function (
bool
)
{
},
/**
* @method getOnDidFailLoading
* @return {function}
*/
getOnDidFailLoading : function (
)
{
return std::function<void (cocos2d::experimental::ui::WebView , std::basic_string<char> &)>;
},
/**
* @method loadFile
* @param {String} arg0
*/
loadFile : function (
str
)
{
},
/**
* @method loadURL
* @param {String} arg0
*/
loadURL : function (
str
)
{
},
/**
* @method setBounces
* @param {bool} arg0
*/
setBounces : function (
bool
)
{
},
/**
* @method evaluateJS
* @param {String} arg0
*/
evaluateJS : function (
str
)
{
},
/**
* @method setOnJSCallback
* @param {function} arg0
*/
setOnJSCallback : function (
func
)
{
},
/**
* @method getOnJSCallback
* @return {function}
*/
getOnJSCallback : function (
)
{
return std::function<void (cocos2d::experimental::ui::WebView , std::basic_string<char> &)>;
},
/**
* @method canGoForward
* @return {bool}
*/
canGoForward : function (
)
{
return false;
},
/**
* @method getOnShouldStartLoading
* @return {function}
*/
getOnShouldStartLoading : function (
)
{
return std::function<bool (cocos2d::experimental::ui::WebView , std::basic_string<char> &)>;
},
/**
* @method stopLoading
*/
stopLoading : function (
)
{
},
/**
* @method reload
*/
reload : function (
)
{
},
/**
* @method loadData
* @param {cc.Data} arg0
* @param {String} arg1
* @param {String} arg2
* @param {String} arg3
*/
loadData : function (
data,
str,
str,
str
)
{
},
/**
* @method setJavascriptInterfaceScheme
* @param {String} arg0
*/
setJavascriptInterfaceScheme : function (
str
)
{
},
/**
* @method setOnDidFinishLoading
* @param {function} arg0
*/
setOnDidFinishLoading : function (
func
)
{
},
/**
* @method getOnDidFinishLoading
* @return {function}
*/
getOnDidFinishLoading : function (
)
{
return std::function<void (cocos2d::experimental::ui::WebView , std::basic_string<char> &)>;
},
/**
* @method create
* @return {cc.experimental::ui::WebView}
*/
create : function (
)
{
return cc.experimental::ui::WebView;
},
/**
* @method WebView
* @constructor
*/
WebView : function (
)
{
},
};
@@ -4,12 +4,12 @@
#include "scripting/js-bindings/manual/jsb_global.h"
#include "audio/include/AudioEngine.h"
se::Object* __jsb_cocos2d_experimental_AudioProfile_proto = nullptr;
se::Class* __jsb_cocos2d_experimental_AudioProfile_class = nullptr;
se::Object* __jsb_cocos2d_AudioProfile_proto = nullptr;
se::Class* __jsb_cocos2d_AudioProfile_class = nullptr;
static bool js_audioengine_AudioProfile_get_name(se::State& s)
{
cocos2d::experimental::AudioProfile* cobj = (cocos2d::experimental::AudioProfile*)s.nativeThisObject();
cocos2d::AudioProfile* cobj = (cocos2d::AudioProfile*)s.nativeThisObject();
SE_PRECONDITION2(cobj, false, "js_audioengine_AudioProfile_get_name : Invalid Native Object");
CC_UNUSED bool ok = true;
@@ -23,7 +23,7 @@ SE_BIND_PROP_GET(js_audioengine_AudioProfile_get_name)
static bool js_audioengine_AudioProfile_set_name(se::State& s)
{
const auto& args = s.args();
cocos2d::experimental::AudioProfile* cobj = (cocos2d::experimental::AudioProfile*)s.nativeThisObject();
cocos2d::AudioProfile* cobj = (cocos2d::AudioProfile*)s.nativeThisObject();
SE_PRECONDITION2(cobj, false, "js_audioengine_AudioProfile_set_name : Invalid Native Object");
CC_UNUSED bool ok = true;
@@ -37,7 +37,7 @@ SE_BIND_PROP_SET(js_audioengine_AudioProfile_set_name)
static bool js_audioengine_AudioProfile_get_maxInstances(se::State& s)
{
cocos2d::experimental::AudioProfile* cobj = (cocos2d::experimental::AudioProfile*)s.nativeThisObject();
cocos2d::AudioProfile* cobj = (cocos2d::AudioProfile*)s.nativeThisObject();
SE_PRECONDITION2(cobj, false, "js_audioengine_AudioProfile_get_maxInstances : Invalid Native Object");
CC_UNUSED bool ok = true;
@@ -51,7 +51,7 @@ SE_BIND_PROP_GET(js_audioengine_AudioProfile_get_maxInstances)
static bool js_audioengine_AudioProfile_set_maxInstances(se::State& s)
{
const auto& args = s.args();
cocos2d::experimental::AudioProfile* cobj = (cocos2d::experimental::AudioProfile*)s.nativeThisObject();
cocos2d::AudioProfile* cobj = (cocos2d::AudioProfile*)s.nativeThisObject();
SE_PRECONDITION2(cobj, false, "js_audioengine_AudioProfile_set_maxInstances : Invalid Native Object");
CC_UNUSED bool ok = true;
@@ -65,7 +65,7 @@ SE_BIND_PROP_SET(js_audioengine_AudioProfile_set_maxInstances)
static bool js_audioengine_AudioProfile_get_minDelay(se::State& s)
{
cocos2d::experimental::AudioProfile* cobj = (cocos2d::experimental::AudioProfile*)s.nativeThisObject();
cocos2d::AudioProfile* cobj = (cocos2d::AudioProfile*)s.nativeThisObject();
SE_PRECONDITION2(cobj, false, "js_audioengine_AudioProfile_get_minDelay : Invalid Native Object");
CC_UNUSED bool ok = true;
@@ -79,7 +79,7 @@ SE_BIND_PROP_GET(js_audioengine_AudioProfile_get_minDelay)
static bool js_audioengine_AudioProfile_set_minDelay(se::State& s)
{
const auto& args = s.args();
cocos2d::experimental::AudioProfile* cobj = (cocos2d::experimental::AudioProfile*)s.nativeThisObject();
cocos2d::AudioProfile* cobj = (cocos2d::AudioProfile*)s.nativeThisObject();
SE_PRECONDITION2(cobj, false, "js_audioengine_AudioProfile_set_minDelay : Invalid Native Object");
CC_UNUSED bool ok = true;
@@ -91,33 +91,33 @@ static bool js_audioengine_AudioProfile_set_minDelay(se::State& s)
}
SE_BIND_PROP_SET(js_audioengine_AudioProfile_set_minDelay)
SE_DECLARE_FINALIZE_FUNC(js_cocos2d_experimental_AudioProfile_finalize)
SE_DECLARE_FINALIZE_FUNC(js_cocos2d_AudioProfile_finalize)
static bool js_audioengine_AudioProfile_constructor(se::State& s)
{
cocos2d::experimental::AudioProfile* cobj = new (std::nothrow) cocos2d::experimental::AudioProfile();
cocos2d::AudioProfile* cobj = new (std::nothrow) cocos2d::AudioProfile();
s.thisObject()->setPrivateData(cobj);
se::NonRefNativePtrCreatedByCtorMap::emplace(cobj);
return true;
}
SE_BIND_CTOR(js_audioengine_AudioProfile_constructor, __jsb_cocos2d_experimental_AudioProfile_class, js_cocos2d_experimental_AudioProfile_finalize)
SE_BIND_CTOR(js_audioengine_AudioProfile_constructor, __jsb_cocos2d_AudioProfile_class, js_cocos2d_AudioProfile_finalize)
static bool js_cocos2d_experimental_AudioProfile_finalize(se::State& s)
static bool js_cocos2d_AudioProfile_finalize(se::State& s)
{
CCLOGINFO("jsbindings: finalizing JS object %p (cocos2d::experimental::AudioProfile)", s.nativeThisObject());
CCLOGINFO("jsbindings: finalizing JS object %p (cocos2d::AudioProfile)", s.nativeThisObject());
auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject());
if (iter != se::NonRefNativePtrCreatedByCtorMap::end())
{
se::NonRefNativePtrCreatedByCtorMap::erase(iter);
cocos2d::experimental::AudioProfile* cobj = (cocos2d::experimental::AudioProfile*)s.nativeThisObject();
cocos2d::AudioProfile* cobj = (cocos2d::AudioProfile*)s.nativeThisObject();
delete cobj;
}
return true;
}
SE_BIND_FINALIZE_FUNC(js_cocos2d_experimental_AudioProfile_finalize)
SE_BIND_FINALIZE_FUNC(js_cocos2d_AudioProfile_finalize)
bool js_register_audioengine_AudioProfile(se::Object* obj)
{
@@ -126,19 +126,19 @@ bool js_register_audioengine_AudioProfile(se::Object* obj)
cls->defineProperty("name", _SE(js_audioengine_AudioProfile_get_name), _SE(js_audioengine_AudioProfile_set_name));
cls->defineProperty("maxInstances", _SE(js_audioengine_AudioProfile_get_maxInstances), _SE(js_audioengine_AudioProfile_set_maxInstances));
cls->defineProperty("minDelay", _SE(js_audioengine_AudioProfile_get_minDelay), _SE(js_audioengine_AudioProfile_set_minDelay));
cls->defineFinalizeFunction(_SE(js_cocos2d_experimental_AudioProfile_finalize));
cls->defineFinalizeFunction(_SE(js_cocos2d_AudioProfile_finalize));
cls->install();
JSBClassType::registerClass<cocos2d::experimental::AudioProfile>(cls);
JSBClassType::registerClass<cocos2d::AudioProfile>(cls);
__jsb_cocos2d_experimental_AudioProfile_proto = cls->getProto();
__jsb_cocos2d_experimental_AudioProfile_class = cls;
__jsb_cocos2d_AudioProfile_proto = cls->getProto();
__jsb_cocos2d_AudioProfile_class = cls;
se::ScriptEngine::getInstance()->clearException();
return true;
}
se::Object* __jsb_cocos2d_experimental_AudioEngine_proto = nullptr;
se::Class* __jsb_cocos2d_experimental_AudioEngine_class = nullptr;
se::Object* __jsb_cocos2d_AudioEngine_proto = nullptr;
se::Class* __jsb_cocos2d_AudioEngine_class = nullptr;
static bool js_audioengine_AudioEngine_lazyInit(se::State& s)
{
@@ -146,7 +146,7 @@ static bool js_audioengine_AudioEngine_lazyInit(se::State& s)
size_t argc = args.size();
CC_UNUSED bool ok = true;
if (argc == 0) {
bool result = cocos2d::experimental::AudioEngine::lazyInit();
bool result = cocos2d::AudioEngine::lazyInit();
ok &= boolean_to_seval(result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_lazyInit : Error processing arguments");
return true;
@@ -167,7 +167,7 @@ static bool js_audioengine_AudioEngine_setCurrentTime(se::State& s)
do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false);
ok &= seval_to_float(args[1], &arg1);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_setCurrentTime : Error processing arguments");
bool result = cocos2d::experimental::AudioEngine::setCurrentTime(arg0, arg1);
bool result = cocos2d::AudioEngine::setCurrentTime(arg0, arg1);
ok &= boolean_to_seval(result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_setCurrentTime : Error processing arguments");
return true;
@@ -186,7 +186,7 @@ static bool js_audioengine_AudioEngine_getVolume(se::State& s)
int arg0 = 0;
do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getVolume : Error processing arguments");
float result = cocos2d::experimental::AudioEngine::getVolume(arg0);
float result = cocos2d::AudioEngine::getVolume(arg0);
ok &= float_to_seval(result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getVolume : Error processing arguments");
return true;
@@ -205,7 +205,7 @@ static bool js_audioengine_AudioEngine_uncache(se::State& s)
std::string arg0;
ok &= seval_to_std_string(args[0], &arg0);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_uncache : Error processing arguments");
cocos2d::experimental::AudioEngine::uncache(arg0);
cocos2d::AudioEngine::uncache(arg0);
return true;
}
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1);
@@ -218,7 +218,7 @@ static bool js_audioengine_AudioEngine_resumeAll(se::State& s)
const auto& args = s.args();
size_t argc = args.size();
if (argc == 0) {
cocos2d::experimental::AudioEngine::resumeAll();
cocos2d::AudioEngine::resumeAll();
return true;
}
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0);
@@ -231,7 +231,7 @@ static bool js_audioengine_AudioEngine_stopAll(se::State& s)
const auto& args = s.args();
size_t argc = args.size();
if (argc == 0) {
cocos2d::experimental::AudioEngine::stopAll();
cocos2d::AudioEngine::stopAll();
return true;
}
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0);
@@ -248,7 +248,7 @@ static bool js_audioengine_AudioEngine_pause(se::State& s)
int arg0 = 0;
do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_pause : Error processing arguments");
cocos2d::experimental::AudioEngine::pause(arg0);
cocos2d::AudioEngine::pause(arg0);
return true;
}
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1);
@@ -261,7 +261,7 @@ static bool js_audioengine_AudioEngine_end(se::State& s)
const auto& args = s.args();
size_t argc = args.size();
if (argc == 0) {
cocos2d::experimental::AudioEngine::end();
cocos2d::AudioEngine::end();
return true;
}
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0);
@@ -275,7 +275,7 @@ static bool js_audioengine_AudioEngine_getMaxAudioInstance(se::State& s)
size_t argc = args.size();
CC_UNUSED bool ok = true;
if (argc == 0) {
int result = cocos2d::experimental::AudioEngine::getMaxAudioInstance();
int result = cocos2d::AudioEngine::getMaxAudioInstance();
ok &= int32_to_seval(result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getMaxAudioInstance : Error processing arguments");
return true;
@@ -291,7 +291,7 @@ static bool js_audioengine_AudioEngine_isEnabled(se::State& s)
size_t argc = args.size();
CC_UNUSED bool ok = true;
if (argc == 0) {
bool result = cocos2d::experimental::AudioEngine::isEnabled();
bool result = cocos2d::AudioEngine::isEnabled();
ok &= boolean_to_seval(result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_isEnabled : Error processing arguments");
return true;
@@ -310,7 +310,7 @@ static bool js_audioengine_AudioEngine_getCurrentTime(se::State& s)
int arg0 = 0;
do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getCurrentTime : Error processing arguments");
float result = cocos2d::experimental::AudioEngine::getCurrentTime(arg0);
float result = cocos2d::AudioEngine::getCurrentTime(arg0);
ok &= float_to_seval(result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getCurrentTime : Error processing arguments");
return true;
@@ -329,7 +329,7 @@ static bool js_audioengine_AudioEngine_setMaxAudioInstance(se::State& s)
int arg0 = 0;
do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_setMaxAudioInstance : Error processing arguments");
bool result = cocos2d::experimental::AudioEngine::setMaxAudioInstance(arg0);
bool result = cocos2d::AudioEngine::setMaxAudioInstance(arg0);
ok &= boolean_to_seval(result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_setMaxAudioInstance : Error processing arguments");
return true;
@@ -348,7 +348,7 @@ static bool js_audioengine_AudioEngine_isLoop(se::State& s)
int arg0 = 0;
do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_isLoop : Error processing arguments");
bool result = cocos2d::experimental::AudioEngine::isLoop(arg0);
bool result = cocos2d::AudioEngine::isLoop(arg0);
ok &= boolean_to_seval(result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_isLoop : Error processing arguments");
return true;
@@ -363,7 +363,7 @@ static bool js_audioengine_AudioEngine_pauseAll(se::State& s)
const auto& args = s.args();
size_t argc = args.size();
if (argc == 0) {
cocos2d::experimental::AudioEngine::pauseAll();
cocos2d::AudioEngine::pauseAll();
return true;
}
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0);
@@ -376,7 +376,7 @@ static bool js_audioengine_AudioEngine_uncacheAll(se::State& s)
const auto& args = s.args();
size_t argc = args.size();
if (argc == 0) {
cocos2d::experimental::AudioEngine::uncacheAll();
cocos2d::AudioEngine::uncacheAll();
return true;
}
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0);
@@ -395,7 +395,7 @@ static bool js_audioengine_AudioEngine_setVolume(se::State& s)
do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false);
ok &= seval_to_float(args[1], &arg1);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_setVolume : Error processing arguments");
cocos2d::experimental::AudioEngine::setVolume(arg0, arg1);
cocos2d::AudioEngine::setVolume(arg0, arg1);
return true;
}
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2);
@@ -445,7 +445,7 @@ static bool js_audioengine_AudioEngine_preload(se::State& s)
} while(false)
;
if (!ok) { ok = true; break; }
cocos2d::experimental::AudioEngine::preload(arg0, arg1);
cocos2d::AudioEngine::preload(arg0, arg1);
return true;
}
} while (false);
@@ -454,7 +454,7 @@ static bool js_audioengine_AudioEngine_preload(se::State& s)
std::string arg0;
ok &= seval_to_std_string(args[0], &arg0);
if (!ok) { ok = true; break; }
cocos2d::experimental::AudioEngine::preload(arg0);
cocos2d::AudioEngine::preload(arg0);
return true;
}
} while (false);
@@ -472,7 +472,7 @@ static bool js_audioengine_AudioEngine_setEnabled(se::State& s)
bool arg0;
ok &= seval_to_boolean(args[0], &arg0);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_setEnabled : Error processing arguments");
cocos2d::experimental::AudioEngine::setEnabled(arg0);
cocos2d::AudioEngine::setEnabled(arg0);
return true;
}
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1);
@@ -489,7 +489,7 @@ static bool js_audioengine_AudioEngine_play2d(se::State& s)
std::string arg0;
ok &= seval_to_std_string(args[0], &arg0);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_play2d : Error processing arguments");
int result = cocos2d::experimental::AudioEngine::play2d(arg0);
int result = cocos2d::AudioEngine::play2d(arg0);
ok &= int32_to_seval(result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_play2d : Error processing arguments");
return true;
@@ -500,7 +500,7 @@ static bool js_audioengine_AudioEngine_play2d(se::State& s)
ok &= seval_to_std_string(args[0], &arg0);
ok &= seval_to_boolean(args[1], &arg1);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_play2d : Error processing arguments");
int result = cocos2d::experimental::AudioEngine::play2d(arg0, arg1);
int result = cocos2d::AudioEngine::play2d(arg0, arg1);
ok &= int32_to_seval(result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_play2d : Error processing arguments");
return true;
@@ -513,7 +513,7 @@ static bool js_audioengine_AudioEngine_play2d(se::State& s)
ok &= seval_to_boolean(args[1], &arg1);
ok &= seval_to_float(args[2], &arg2);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_play2d : Error processing arguments");
int result = cocos2d::experimental::AudioEngine::play2d(arg0, arg1, arg2);
int result = cocos2d::AudioEngine::play2d(arg0, arg1, arg2);
ok &= int32_to_seval(result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_play2d : Error processing arguments");
return true;
@@ -522,13 +522,13 @@ static bool js_audioengine_AudioEngine_play2d(se::State& s)
std::string arg0;
bool arg1;
float arg2 = 0;
const cocos2d::experimental::AudioProfile* arg3 = nullptr;
const cocos2d::AudioProfile* arg3 = nullptr;
ok &= seval_to_std_string(args[0], &arg0);
ok &= seval_to_boolean(args[1], &arg1);
ok &= seval_to_float(args[2], &arg2);
ok &= seval_to_native_ptr(args[3], &arg3);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_play2d : Error processing arguments");
int result = cocos2d::experimental::AudioEngine::play2d(arg0, arg1, arg2, arg3);
int result = cocos2d::AudioEngine::play2d(arg0, arg1, arg2, arg3);
ok &= int32_to_seval(result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_play2d : Error processing arguments");
return true;
@@ -547,7 +547,7 @@ static bool js_audioengine_AudioEngine_getState(se::State& s)
int arg0 = 0;
do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getState : Error processing arguments");
int result = (int)cocos2d::experimental::AudioEngine::getState(arg0);
int result = (int)cocos2d::AudioEngine::getState(arg0);
ok &= int32_to_seval(result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getState : Error processing arguments");
return true;
@@ -566,7 +566,7 @@ static bool js_audioengine_AudioEngine_resume(se::State& s)
int arg0 = 0;
do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_resume : Error processing arguments");
cocos2d::experimental::AudioEngine::resume(arg0);
cocos2d::AudioEngine::resume(arg0);
return true;
}
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1);
@@ -583,7 +583,7 @@ static bool js_audioengine_AudioEngine_stop(se::State& s)
int arg0 = 0;
do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_stop : Error processing arguments");
cocos2d::experimental::AudioEngine::stop(arg0);
cocos2d::AudioEngine::stop(arg0);
return true;
}
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1);
@@ -600,7 +600,7 @@ static bool js_audioengine_AudioEngine_getDuration(se::State& s)
int arg0 = 0;
do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getDuration : Error processing arguments");
float result = cocos2d::experimental::AudioEngine::getDuration(arg0);
float result = cocos2d::AudioEngine::getDuration(arg0);
ok &= float_to_seval(result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getDuration : Error processing arguments");
return true;
@@ -621,7 +621,7 @@ static bool js_audioengine_AudioEngine_setLoop(se::State& s)
do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false);
ok &= seval_to_boolean(args[1], &arg1);
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_setLoop : Error processing arguments");
cocos2d::experimental::AudioEngine::setLoop(arg0, arg1);
cocos2d::AudioEngine::setLoop(arg0, arg1);
return true;
}
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2);
@@ -635,8 +635,8 @@ static bool js_audioengine_AudioEngine_getDefaultProfile(se::State& s)
size_t argc = args.size();
CC_UNUSED bool ok = true;
if (argc == 0) {
cocos2d::experimental::AudioProfile* result = cocos2d::experimental::AudioEngine::getDefaultProfile();
ok &= native_ptr_to_seval<cocos2d::experimental::AudioProfile>((cocos2d::experimental::AudioProfile*)result, &s.rval());
cocos2d::AudioProfile* result = cocos2d::AudioEngine::getDefaultProfile();
ok &= native_ptr_to_seval<cocos2d::AudioProfile>((cocos2d::AudioProfile*)result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getDefaultProfile : Error processing arguments");
return true;
}
@@ -686,7 +686,7 @@ static bool js_audioengine_AudioEngine_setFinishCallback(se::State& s)
} while(false)
;
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_setFinishCallback : Error processing arguments");
cocos2d::experimental::AudioEngine::setFinishCallback(arg0, arg1);
cocos2d::AudioEngine::setFinishCallback(arg0, arg1);
return true;
}
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2);
@@ -704,8 +704,8 @@ static bool js_audioengine_AudioEngine_getProfile(se::State& s)
std::string arg0;
ok &= seval_to_std_string(args[0], &arg0);
if (!ok) { ok = true; break; }
cocos2d::experimental::AudioProfile* result = cocos2d::experimental::AudioEngine::getProfile(arg0);
ok &= native_ptr_to_seval<cocos2d::experimental::AudioProfile>((cocos2d::experimental::AudioProfile*)result, &s.rval());
cocos2d::AudioProfile* result = cocos2d::AudioEngine::getProfile(arg0);
ok &= native_ptr_to_seval<cocos2d::AudioProfile>((cocos2d::AudioProfile*)result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getProfile : Error processing arguments");
return true;
}
@@ -715,8 +715,8 @@ static bool js_audioengine_AudioEngine_getProfile(se::State& s)
int arg0 = 0;
do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false);
if (!ok) { ok = true; break; }
cocos2d::experimental::AudioProfile* result = cocos2d::experimental::AudioEngine::getProfile(arg0);
ok &= native_ptr_to_seval<cocos2d::experimental::AudioProfile>((cocos2d::experimental::AudioProfile*)result, &s.rval());
cocos2d::AudioProfile* result = cocos2d::AudioEngine::getProfile(arg0);
ok &= native_ptr_to_seval<cocos2d::AudioProfile>((cocos2d::AudioProfile*)result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getProfile : Error processing arguments");
return true;
}
@@ -732,7 +732,7 @@ static bool js_audioengine_AudioEngine_getPlayingAudioCount(se::State& s)
size_t argc = args.size();
CC_UNUSED bool ok = true;
if (argc == 0) {
int result = cocos2d::experimental::AudioEngine::getPlayingAudioCount();
int result = cocos2d::AudioEngine::getPlayingAudioCount();
ok &= int32_to_seval(result, &s.rval());
SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getPlayingAudioCount : Error processing arguments");
return true;
@@ -778,10 +778,10 @@ bool js_register_audioengine_AudioEngine(se::Object* obj)
cls->defineStaticFunction("getProfile", _SE(js_audioengine_AudioEngine_getProfile));
cls->defineStaticFunction("getPlayingAudioCount", _SE(js_audioengine_AudioEngine_getPlayingAudioCount));
cls->install();
JSBClassType::registerClass<cocos2d::experimental::AudioEngine>(cls);
JSBClassType::registerClass<cocos2d::AudioEngine>(cls);
__jsb_cocos2d_experimental_AudioEngine_proto = cls->getProto();
__jsb_cocos2d_experimental_AudioEngine_class = cls;
__jsb_cocos2d_AudioEngine_proto = cls->getProto();
__jsb_cocos2d_AudioEngine_class = cls;
se::ScriptEngine::getInstance()->clearException();
return true;
@@ -4,17 +4,17 @@
#include "cocos/scripting/js-bindings/jswrapper/SeApi.h"
extern se::Object* __jsb_cocos2d_experimental_AudioProfile_proto;
extern se::Class* __jsb_cocos2d_experimental_AudioProfile_class;
extern se::Object* __jsb_cocos2d_AudioProfile_proto;
extern se::Class* __jsb_cocos2d_AudioProfile_class;
bool js_register_cocos2d_experimental_AudioProfile(se::Object* obj);
bool js_register_cocos2d_AudioProfile(se::Object* obj);
bool register_all_audioengine(se::Object* obj);
SE_DECLARE_FUNC(js_audioengine_AudioProfile_AudioProfile);
extern se::Object* __jsb_cocos2d_experimental_AudioEngine_proto;
extern se::Class* __jsb_cocos2d_experimental_AudioEngine_class;
extern se::Object* __jsb_cocos2d_AudioEngine_proto;
extern se::Class* __jsb_cocos2d_AudioEngine_class;
bool js_register_cocos2d_experimental_AudioEngine(se::Object* obj);
bool js_register_cocos2d_AudioEngine(se::Object* obj);
bool register_all_audioengine(se::Object* obj);
SE_DECLARE_FUNC(js_audioengine_AudioEngine_lazyInit);
SE_DECLARE_FUNC(js_audioengine_AudioEngine_setCurrentTime);
@@ -35,7 +35,6 @@
using namespace cocos2d;
using namespace cocos2d::extension;
using namespace cocos2d::experimental;
static bool js_cocos2dx_extension_loadRemoteImage(se::State& s)
{
@@ -40,7 +40,6 @@
#include <regex>
using namespace cocos2d;
using namespace cocos2d::experimental;
se::Object* __jsbObj = nullptr;
se::Object* __glObj = nullptr;
@@ -86,7 +85,7 @@ void jsb_init_file_operation_delegate()
SE_REPORT_ERROR("Can't decrypt code for %s", byteCodePath.c_str());
return;
}
if (ZipUtils::isGZipBuffer(data,dataLen)) {
uint8_t* unpackedData;
ssize_t unpackedLen = ZipUtils::inflateMemory(data, dataLen,&unpackedData);
@@ -95,7 +94,7 @@ void jsb_init_file_operation_delegate()
SE_REPORT_ERROR("Can't decrypt code for %s", byteCodePath.c_str());
return;
}
readCallback(unpackedData, unpackedLen);
free(data);
free(unpackedData);
@@ -121,12 +120,12 @@ void jsb_init_file_operation_delegate()
uint32_t dataLen;
uint8_t* data = xxtea_decrypt((uint8_t*)fileData.getBytes(), (uint32_t)fileData.getSize(), (uint8_t*)xxteaKey.c_str(), (uint32_t)xxteaKey.size(), &dataLen);
if (data == nullptr) {
SE_REPORT_ERROR("Can't decrypt code for %s", byteCodePath.c_str());
return "";
}
if (ZipUtils::isGZipBuffer(data,dataLen)) {
uint8_t* unpackedData;
ssize_t unpackedLen = ZipUtils::inflateMemory(data, dataLen,&unpackedData);
@@ -134,11 +133,11 @@ void jsb_init_file_operation_delegate()
SE_REPORT_ERROR("Can't decrypt code for %s", byteCodePath.c_str());
return "";
}
std::string ret(reinterpret_cast<const char*>(unpackedData), unpackedLen);
free(unpackedData);
free(data);
return ret;
}
else {
@@ -642,7 +641,7 @@ namespace
if (freeData)
delete [] data;
}
uint32_t length = 0;
uint32_t width = 0;
uint32_t height = 0;
@@ -655,10 +654,10 @@ namespace
bool hasAlpha = false;
bool hasPremultipliedAlpha = false;
bool compressed = false;
bool freeData = false;
};
struct ImageInfo* createImageInfo(const Image* img)
{
struct ImageInfo* imgInfo = new struct ImageInfo();
@@ -666,18 +665,18 @@ namespace
imgInfo->width = img->getWidth();
imgInfo->height = img->getHeight();
imgInfo->data = img->getData();
const auto& pixelFormatInfo = img->getPixelFormatInfo();
imgInfo->glFormat = pixelFormatInfo.format;
imgInfo->glInternalFormat = pixelFormatInfo.internalFormat;
imgInfo->type = pixelFormatInfo.type;
imgInfo->bpp = img->getBitPerPixel();
imgInfo->numberOfMipmaps = img->getNumberOfMipmaps();
imgInfo->hasAlpha = img->hasAlpha();
imgInfo->hasPremultipliedAlpha = img->hasPremultipliedAlpha();
imgInfo->compressed = img->isCompressed();
// Convert to RGBA888 because standard web api will return only RGBA888.
// If not, then it may have issue in glTexSubImage. For example, engine
// will create a big texture, and update its content with small pictures.
@@ -702,7 +701,7 @@ namespace
imgInfo->glInternalFormat = GL_RGBA;
imgInfo->freeData = true;
}
return imgInfo;
}
}
@@ -840,7 +839,7 @@ bool jsb_global_load_image(const std::string& path, const se::Value& callbackVal
std::string fullPath(FileUtils::getInstance()->fullPathForFilename(path));
if (0 == path.find("file://"))
fullPath = FileUtils::getInstance()->fullPathForFilename(path.substr(strlen("file://")));
if (fullPath.empty())
{
SE_REPORT_ERROR("File (%s) doesn't exist!", path.c_str());
@@ -992,22 +991,22 @@ static bool JSB_showInputBox(se::State& s)
bool ok;
se::Value tmp;
const auto& obj = args[0].toObject();
cocos2d::EditBox::ShowInfo showInfo;
ok = obj->getProperty("defaultValue", &tmp);
SE_PRECONDITION2(ok && tmp.isString(), false, "defaultValue is invalid!");
showInfo.defaultValue = tmp.toString();
ok = obj->getProperty("maxLength", &tmp);
SE_PRECONDITION2(ok && tmp.isNumber(), false, "maxLength is invalid!");
showInfo.maxLength = tmp.toInt32();
ok = obj->getProperty("multiple", &tmp);
SE_PRECONDITION2(ok && tmp.isBoolean(), false, "multiple is invalid!");
showInfo.isMultiline = tmp.toBoolean();
if (obj->getProperty("confirmHold", &tmp))
{
SE_PRECONDITION2(tmp.isBoolean(), false, "confirmHold is invalid!");
@@ -1015,14 +1014,14 @@ static bool JSB_showInputBox(se::State& s)
showInfo.confirmHold = tmp.toBoolean();
}
if (obj->getProperty("confirmType", &tmp))
{
SE_PRECONDITION2(tmp.isString(), false, "confirmType is invalid!");
if (!tmp.isUndefined())
showInfo.confirmType = tmp.toString();
}
if (obj->getProperty("inputType", &tmp))
{
SE_PRECONDITION2(tmp.isString(), false, "inputType is invalid!");
@@ -1030,7 +1029,7 @@ static bool JSB_showInputBox(se::State& s)
showInfo.inputType = tmp.toString();
}
if (obj->getProperty("originX", &tmp))
{
SE_PRECONDITION2(tmp.isNumber(), false, "originX is invalid!");
@@ -1058,12 +1057,12 @@ static bool JSB_showInputBox(se::State& s)
if (! tmp.isUndefined())
showInfo.height = tmp.toInt32();
}
EditBox::show(showInfo);
return true;
}
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1);
return false;
}