Show
Ignore:
Timestamp:
11/06/09 14:33:37 (3 years ago)
Author:
rgareus <rgareus@…>
Parents:
6ad46b97c08fbff92c569737162513719a8cee8d
Children:
c921505c5ad730161fe4d8eb95950eb4a3f30173
git-committer:
rgareus <rgareus@CITU-Cuboute.local> / 2009-11-06T15:33:37Z+0100
Message:

various updates..

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • oggzcap/src/MyController.mm

    r0a70e0d r2080ee9  
    44 
    55extern "C" { 
    6         int myOggfwd_init( char* outIceIp, int outIcePort, char* outIceMount ) ; 
     6        int myOggfwd_init( const char* outIceIp, int outIcePort, const char* outIceMount, 
     7                           const char *description, const char *genre, const char *name, const char *url );              
    78        void myOggfwd_close() ; 
    89        void encoder_example_init(int inW, int inH, int inFramerate, int in_video_r, int in_video_q) ; 
     
    261262} 
    262263 
    263 -(void)stopIn 
    264 { 
    265         [self pLog:@"Stopping Video In...\n"] ; 
    266          
    267         ////////////////// Temp exchange File Things 
    268         inoutExchangeFile = fopen("/InOut/Config/InOutComponent/InOutComponentControl.txt", "wb") ; 
    269         char wBuff[] = {'0','\n','\n','\n'} ;  
    270         fwrite(wBuff,1,4,inoutExchangeFile) ; 
    271         if(inoutExchangeFile) fclose(inoutExchangeFile) ; 
    272          
    273         inListening = FALSE ; 
    274          
    275         ////////////////// REMOVE VIEWER if toggle on 
    276         if(showInPreview) [self closeInPreview] ; 
    277          
    278         ////////////////// Clear Display 
    279         [self clearInDisplay] ; 
    280                  
    281         [startInButton setEnabled:YES]; 
    282         [stopInButton setEnabled:NO]; 
    283 } 
    284  
    285 - (void)openInPreview 
    286 { 
    287         printf("INOUT - Open InPreview Window\n") ; 
    288          
    289         if (!videOpened) { 
    290                 vide = [[SGVideo alloc] initWithSeqGrab:mGrabber myView:inPreviewView]; 
    291                 if(vide!=nil) { 
    292                         videOpened = TRUE ; 
    293                         [vide setUsage:seqGrabPreview + seqGrabRecord + seqGrabPlayDuringRecord]; 
    294                         [mGrabber preview]; 
    295                 } 
    296                 else { 
    297                         NSRunAlertPanel(@"Video Input Problem",  
    298             @"Couldn't create a video channel.  Check your video device connections and try again.", 
    299             nil, nil, nil); 
    300                 } 
    301         } 
    302         else { 
    303                 [mGrabber preview]; 
    304         } 
    305         //if(vide!=nil) [vide release]; // it was retained by its mGrabber 
    306 } 
    307 - (void)closeInPreview 
    308 { 
    309         printf("INOUT - Close InPreview Window\n") ; 
    310          
    311         [mGrabber stop]; 
    312          
    313         //SGChan* doomedChan = [[mGrabber channels] objectAtIndex:myIndex]; 
    314         //[mGrabber removeChannel:doomedChan]; 
    315 } 
    316  
    317264-(void)startOut 
    318265{        
     
    322269        int tmpIcecastPort = [outIcecastPortTF intValue] ; 
    323270        NSString *tmpIcecastMount = [outIcecastMountTF stringValue] ; 
     271 
     272        NSString *tmpStrName   = [projectName stringValue] ; 
     273        NSString *tmpStrAuthor = [projectAuthor stringValue] ;  
     274        NSString *tmpStrDescr  = [projectDescr stringValue] ; 
     275        NSString *tmpStrTags   = [projectLocation stringValue] ; 
    324276         
    325277        [self pLog:[NSString stringWithFormat:@"Starting Video Out to Icecast2 server:\n  http://%@:%d/%@\n",tmpIcecastIp,tmpIcecastPort,tmpIcecastMount]] ; 
    326  
     278/* 
    327279        char *cip = (char*)malloc(sizeof(char)*99); 
    328         char *cmount = (char*)malloc(sizeof(char)*99); 
     280        char *cmount = (char*)malloc(sizeof(char)*strlen); 
    329281        strcpy(cip, [tmpIcecastIp UTF8String]) ; 
    330282        strcpy(cmount, [tmpIcecastMount UTF8String]) ; 
    331          
    332         int iceConnect = myOggfwd_init(cip, tmpIcecastPort, cmount) ; 
     283*/ 
     284        const char* cip    = [tmpIcecastIp UTF8String]; 
     285        const char* cmount = [tmpIcecastMount UTF8String]; 
     286        const char* cname  = [tmpStrName UTF8String]; 
     287        const char* cdesc  = [tmpStrDescr UTF8String]; 
     288        const char* ctags  = [tmpStrTags UTF8String]; 
     289        const char* curl   = [[NSString stringWithFormat:@"http://wiki.citu.info/users/%@\n",tmpStrAuthor] UTF8String] ; // TODO url-escape 
     290         
     291        [self pLog:[NSString stringWithFormat:@"Tags: %@\nDesc: %@\n",tmpStrTags,tmpStrDescr]] ; 
     292 
     293        int iceConnect = myOggfwd_init(cip, tmpIcecastPort, cmount, cdesc, ctags, cname, curl) ; 
    333294         
    334295        if(iceConnect==1) { 
     
    387348                //[showZoneButton setEnabled:NO]; 
    388349                 
     350                [outBitrateTF setEnabled:NO]; 
     351                [outQualityTF setEnabled:NO]; 
     352                [outIcecastIPTF setEnabled:NO]; 
     353                [outIcecastPortTF setEnabled:NO]; 
     354                [outIcecastMountTF setEnabled:NO]; 
     355                [projectName setEnabled:NO]; 
     356                [projectAuthor setEnabled:NO]; 
     357                [projectLocation setEnabled:NO]; 
     358                [projectDescr setEnabled:NO]; 
     359 
    389360                [self setCaptureWindowMode:TRUE] ; 
    390361                [mCaptureTarget makeKeyAndOrderFront:self]; 
     
    432403        [stopOutButton setEnabled:NO]; 
    433404        [showZoneButton setEnabled:YES]; 
    434          
     405 
     406        [outBitrateTF setEnabled:YES]; 
     407        [outQualityTF setEnabled:YES]; 
     408        [outIcecastIPTF setEnabled:YES]; 
     409        [outIcecastPortTF setEnabled:YES]; 
     410        [outIcecastMountTF setEnabled:YES]; 
     411        [projectName setEnabled:YES]; 
     412        [projectAuthor setEnabled:YES]; 
     413        [projectLocation setEnabled:YES]; 
     414        [projectDescr setEnabled:YES]; 
     415 
    435416        [mCaptureTarget close]; 
    436417}