예제 #1
0
 public MobileStore(IPhoneReader reader, IPhoneBinder binder, IPhoneValidator validator, IPhoneSaver saver)
 {
     this.Reader    = reader;
     this.Binder    = binder;
     this.Validator = validator;
     this.Saver     = saver;
 }
예제 #2
0
 public MobileStore(IPhoneReader reader, IPhoneBinder binder, IPhoneValidator validator, IPhoneSaver saver)
 {
     Reader    = reader;
     Binder    = binder;
     Validator = validator;
     Saver     = saver;
 }
예제 #3
0
    /// <summary>
    /// Read the file specified for this instance of FileReader
    /// </summary>
    public ReadStatus read()
    {
        this.reading = true;

        #if UNITY_ANDROID || UNITY_EDITOR

        // Check input
        if (this.path == null || this.path == "") {
            Debug.LogError("Path not specified!");
            this.reading = false;
            return ReadStatus.FAIL;
        } else if (this.format == FileFormat.OGG || this.format == FileFormat.ERROR) {
            Debug.Log("This format: " + this.format.ToString() + " is not supported yet");
            this.reading = false;
            return ReadStatus.UNSUPPORTED_FORMAT;
        }

        // Get audioclip according to file format
        switch (this.format) {
            case FileFormat.WAV:
                readWAV();
                break;
            case FileFormat.MPEG:
                mp3Reader = new MP3(this.path);
                this.frequency = mp3Reader.getFrequency();
                this.channels = mp3Reader.getChannels();
                this.mp3FrameSize = mp3Reader.getFrameSize();
                break;
            case FileFormat.RYT:
                readRytData();
                break;
        }

        #elif UNITY_IPHONE
        if (this.path == null || this.path == "") {
            Debug.LogError("Path not specified!");
            this.reading = false;
            return ReadStatus.FAIL;
        }

        reader = new IPhoneReader(this.path);
        this.frequency = reader.getFrequency();
        this.channels = reader.getChannels();
        #endif

        this.reading = false;
        return ReadStatus.SUCCESS;
    }
 public PhoneInvitation(IPhoneBinder phoneBinder, IPhoneReader phoneReader, IPhoneValidator phoneValidator)
 {
     this.Binder    = phoneBinder;
     this.Reader    = phoneReader;
     this.Validator = phoneValidator;
 }