Package de.sciss.io

Examples of de.sciss.io.AudioFileDescr


    final SpringPanel      recPane;
    final Container        cp        = getContentPane();
    final JPanel        butPane;
    final WindowAdapter      winListener;
    final String        className    = getClass().getName();
    final AudioFileDescr    displayAFD    = doc.getDisplayDescr();
    final JButton        ggPeakReset;
    final JToolBar        tbMonitoring;
    final TimeLabel        lbTime;
    final MessageFormat      frmtPeak    = new MessageFormat( getResourceString( "msgPeak" ), Locale.US ); // XXX Locale.US
    final Object[]        peakArgs    = new Object[1];
View Full Code Here


    final Span[]    fileSpans  = new Span[ audioFiles.length ];
    final AudioFile[]  cacheAFs  = new AudioFile[ audioFiles.length ];
    final String    ourCode    = AbstractApplication.getApplication().getMacOSCreator();
    final int[][]    channelMaps  = createCacheChannelMaps();
    AudioStake      result    = null;
    AudioFileDescr    afd;
    byte[]        appCode;
    AudioFileCacheInfo  infoA, infoB;

    try {
      for( int i = 0; i < cacheAFs.length; i++ ) {
// System.out.println( "openCacheForRead checking '" + f[ i ].getAbsolutePath() + "'" );
       
        if( !f[ i ].isFile() ) return null;
        cacheAFs[ i ] = AudioFile.openAsRead( f[ i ]);
        cacheAFs[ i ].readAppCode();
        afd = cacheAFs[ i ].getDescr();
        final long expected = ((audioFiles[ i ].getFrameNum() + MAXCEILADD) & MAXMASK) >> decimHelps[ 0 ].shift;
        // System.out.println( "expected " + expected+ "; cacheF " +
        // cacheAFs[ i ].getFile().getAbsolutePath() );
        if( expected != afd.length ) {
          // System.err.println( "expected numFrames = "+ expected +
          // ", but got " + afd.length );
          return null;
        }
        appCode = (byte[]) afd.getProperty( AudioFileDescr.KEY_APPCODE );
        // System.err.println( "ourCode = '" + ourCode + "'; afd.appCode
        // = '" + afd.appCode + "'; appCode = '" + appCode + "'" );
        if( ourCode.equals( afd.appCode ) && (appCode != null) ) {
          infoA = AudioFileCacheInfo.decode( appCode );
          if( infoA != null ) {
View Full Code Here

  {
    final File[]      f      = createCacheFileNames();
    if( f == null ) return null;

    final AudioFile[]    audioFiles  = fullScale.getAudioFiles();
    final AudioFileDescr  afdProto  = new AudioFileDescr();
    final CacheManager    cm      = PrefCacheManager.getInstance();
    final Span[]      fileSpans  = new Span[ audioFiles.length ];
    final AudioFile[]    cacheAFs  = new AudioFile[ audioFiles.length ];
    final String      ourCode    = AbstractApplication.getApplication().getMacOSCreator();
    final int[][]      channelMaps  = createCacheChannelMaps();
    AudioStake        result    = null;
    AudioFileDescr      afd;
    AudioFileCacheInfo    info;

    afdProto.type      = AudioFileDescr.TYPE_AIFF;
    afdProto.bitsPerSample  = 32;
    afdProto.sampleFormat  = AudioFileDescr.FORMAT_FLOAT;
    afdProto.rate      = decimHelps[ 0 ].rate; // getRate();
    afdProto.appCode    = ourCode;

    try {
      for( int i = 0; i < f.length; i++ ) {
        cm.removeFile( f[ i ]); // in case it existed
// System.out.println( "openCacheForWrite doing '" + f[ i ].getAbsolutePath() + "'" );
        afd        = new AudioFileDescr( afdProto );
        afd.channels  = channelMaps[ i ].length;
        // System.out.println( "channels = " + afd.channels );
        afd.file    = f[ i ];
        info      = new AudioFileCacheInfo( audioFiles[ i ], decimModel, audioFiles[ i ].getFrameNum() );
        afd.setProperty( AudioFileDescr.KEY_APPCODE, info.encode() );
        cacheAFs[ i = AudioFile.openAsWrite( afd );
        fileSpans[ i = new Span( 0, decimFrameNum );
      }
      // XXX WE NEED A WAY TO CLOSE THE FILES UPON STAKE DISPOSAL XXX
      if( channelMaps.length == 1 ) {
View Full Code Here

    new LooseFocusAction( ggComment );
    ggComment.addFocusListener( new FocusAdapter() {
      public void focusLost( FocusEvent e )
      {
        if( doc != null ) {
          final AudioFileDescr  displayAFD  = doc.getDisplayDescr();
          final String      newText    = ggComment.getText();
          final String      oldText    = (String) displayAFD.getProperty( AudioFileDescr.KEY_COMMENT );
         
          if( !newText.equals( oldText )) {
            doc.getUndoManager().addEdit( new EditChangeAudioFileDescr( this, displayAFD,
              AudioFileDescr.KEY_COMMENT, newText, getResourceString( "editChangeComment" )).perform() );
          }
View Full Code Here

    BasicWindowHandler.showErrorDialog( getWindow(), e, processName );
  }

  protected void updateAFDGadget()
  {
    final AudioFileDescr  displayAFD  = doc.getDisplayDescr();
    final AudioFileDescr[]  afds    = doc.getDescr();
    displayAFD.rate            = timelineRate;
    displayAFD.length          = timelineLen;
    for( int i = 0; i < afds.length; i++ ) {
      afds[ i ].rate          = displayAFD.rate;
      afds[ i ].length        = displayAFD.length;
    }
    ggAudioFileDescr.setText( displayAFD.getFormat() );
   
    pOverlay.performFade( 0f, 1000, 250 );
//    if( !ggAudioFileDescr.isVisible() ) {
//      hideProgressBarTimer.stop();
//      hideProgressBarListener.actionPerformed( null );
View Full Code Here

//    }
  }

  protected void updateCursorFormat()
  {
    final AudioFileDescr displayAFD  = doc.getDisplayDescr();
    csrInfoBits            = displayAFD.bitsPerSample;
    csrInfoIsInt          = displayAFD.sampleFormat == AudioFileDescr.FORMAT_INT;
  }
View Full Code Here

    public void actionPerformed( ActionEvent e )
    {
      final ClipboardTrackList  tl    = doc.getSelectionAsTrackList();
      final Session        doc2;
      final AudioFileDescr    afd, afd2;
      final int          selChans;
      final ProcessingThread    pt;
     
      if( tl == null ) return;
     
      selChans      = tl.getTrackNum( AudioTrail.class );
     
      afd          = doc.getDisplayDescr();
      afd2        = new AudioFileDescr();
      afd2.bitsPerSample  = afd.bitsPerSample;
      afd2.channels    = selChans;
      afd2.rate      = afd.rate;
      afd2.sampleFormat  = afd.sampleFormat;
     
View Full Code Here

     *  wasn't saved before, a file chooser
     *  is shown before.
     */
    public void actionPerformed( ActionEvent e )
    {
      final AudioFileDescr  displayAFD  = doc.getDisplayDescr();     
      final AudioFileDescr[]  afds;

      if( displayAFD.file == null ) {
        afds = actionSaveAs.query( doc.getDescr() );
      } else {
View Full Code Here

  }

  protected InterleavedStreamFile createTempFile( int numChannels, double rate )
  throws IOException
  {
    final AudioFileDescr afd = new AudioFileDescr();
    AudioFile af;
   
    afd.type      = AudioFileDescr.TYPE_AIFF;
    afd.channels    = numChannels;
    afd.rate      = rate;
View Full Code Here

  protected AudioFile[] createTempFiles()
  throws IOException
  {
    // simply use an AIFC file with float format as temp file
    final AudioFileDescr proto  = new AudioFileDescr();
    final AudioFile[] tempFiles  = new AudioFile[ SUBNUM ];
    AudioFileDescr afd;
    proto.type          = AudioFileDescr.TYPE_AIFF;
    proto.channels        = decimChannels;
    proto.bitsPerSample      = 32;
    proto.sampleFormat      = AudioFileDescr.FORMAT_FLOAT;
    // proto.bitsPerSample = 8;
    // proto.sampleFormat = AudioFileDescr.FORMAT_INT;
    try {
      for( int i = 0; i < SUBNUM; i++ ) {
        afd        = new AudioFileDescr( proto );
        afd.file    = IOUtil.createTempFile();
        afd.rate    = decimHelps[ i ].rate;
        tempFiles[ i = AudioFile.openAsWrite( afd );
      }
      return tempFiles;
View Full Code Here

TOP

Related Classes of de.sciss.io.AudioFileDescr

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.