| 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 | | |
| 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) ; |
| | 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 | |
| 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 | |