static A jtvaspc(J jt,A a,A w,C id,VF ado,I cv,I t,I zt,I af,I acr,I wf,I wcr,I f,I r){A q;I*as,*v,*ws; as=AS(a); ws=AS(w); GA(q,INT,f+r,1,0); v=AV(q); if(r>acr){ICPY(v,wf+ws,r); RZ(a=irs2(vec(INT,r-acr,acr+v),a,0L,1L,0L,jtreshape));} if(r>wcr){ICPY(v,af+as,r); RZ(w=irs2(vec(INT,r-wcr,wcr+v),w,0L,1L,0L,jtreshape));} R vasp(a,w,id,ado,cv,t,zt,af,r,wf,r,f,r); } /* prefix agreement on cells */
static F1(jtrsort){A t,z;D d=jt->ct; RZ(w); jt->ct=jt->fuzz; t=over(mag(w),cant1(rect(w))); z=dgrade2(w,cant1(irs2(irs2(t,t,0L,1L,1L,jtindexof),t,0L,1L,1L,jtfrom))); jt->ct=d; R z; }
static REPF(jtrepzdx){A p,q,x;P*wp; RZ(a&&w); if(SPARSE&AT(w)){wp=PAV(w); x=SPA(wp,e);} else x=jt->fill&&AN(jt->fill)?jt->fill:filler(w); RZ(p=repeat(ravel(rect(a)),ravel(stitch(IX(wcr?*(wf+AS(w)):1),num[-1])))); RZ(q=irs2(w,x,0L,wcr,0L,jtover)); R irs2(p,q,0L,1L,wcr+!wcr,jtfrom); } /* (dense complex) # (dense or sparse) */
// This is the derived verb for f/. y static DF1(jtoblique){A x,y;I m,n,r,*u,*v; RZ(w); r=AR(w); // r = rank of w // create y= ,/ w - the _2-cells of w arranged in a list // we just create a header for y, pointing to the data from w RZ(y=gah(MAX(r-1,1),w)); u=AS(w); v=AS(y); // u,v->shape of y if(1>=r){*v=m=AN(w); n=1;}else{m=*u++; n=*u++; *v++=m*n; ICPY(v,u,r-2);} // set shape of y as _2-cells of w // Create x=+"0 1&i./ 2 {. $y RZ(x=irs2(IX(m),IX(n),0L,0L,1L,jtplus)); AR(x)=1; *AS(x)=AN(x); // perform x f/. y, which does the requested operation RZ(x=df2(x,y,sldot(VAV(self)->f))); // Final tweak: the result should have (0 >. <: +/ 2 {. $y) cells. It will, as long as // m and n are both non0: when one is 0, result has 0 cells (but that cell is the correct result // of execution on a fill-cell). Correct the length of the 0 case, when the result length should be nonzero // if((m==0 || n==0) && (m+n>0)){R reitem(sc(m+n-1),x);} This change withdrawn pending further deliberation R x; }
static DF2(rank2i) { DECLF; A h=sv->h; I*v=AV(h); R irs2(a,w,fs,v[1],v[2],f2); }
//------------------------------------------------------------------------ int CEsoundGui::exec(CMenuTarget* parent, const std::string &) { if(esound_active) { puts("[esound.cpp] esound already active..."); return menu_return::RETURN_EXIT_ALL; } std::string tmp; std::string esound_start_script ("start_esound"); std::string esound_start_path1 ("/etc/init.d/"); std::string esound_start_path2 ("/var/etc/init.d/"); std::string esound_start_command; // check for Esound start script in /etc tmp = (esound_start_path1+esound_start_script).c_str(); if (access(tmp.c_str(), X_OK) == 0) { esound_start_script = tmp; } else { // check for Esound start script in /var/etc tmp = (esound_start_path2+esound_start_script).c_str(); if (access(tmp.c_str(), X_OK) == 0) { esound_start_script = tmp; } } if (tmp == "") { printf("[esound.cpp] %s in %s or %s not found, returning...", esound_start_script.c_str(), esound_start_path1.c_str(), esound_start_path2.c_str()); return menu_return::RETURN_EXIT_ALL; } else { esound_start_command = (esound_start_script+' '+g_settings.esound_port); } esound_active = true; if(parent) { parent->hide(); } if(g_settings.video_Format != g_settings.video_backgroundFormat) g_Controld->setVideoFormat(g_settings.video_backgroundFormat); bool usedBackground = m_frameBuffer->getuseBackground(); if (usedBackground) m_frameBuffer->saveBackgroundImage(); m_frameBuffer->loadPal("radiomode.pal", 18, COL_MAXFREE); m_frameBuffer->useBackground(m_frameBuffer->loadBackground(NEUTRINO_ICON_RADIOMODE));// set useBackground true or false m_frameBuffer->paintBackground(); #if defined HAVE_DBOX_HARDWARE || defined HAVE_TRIPLEDRAGON // If Audiomode is OST then save setting and switch to AVS-Mode if(g_settings.audio_avs_Control == CControld::TYPE_OST) { char tmpvol; tmpvol = g_Controld->getVolume(CControld::TYPE_OST); g_Controld->setVolume(100, CControld::TYPE_OST); m_vol_ost = true; g_settings.audio_avs_Control = CControld::TYPE_AVS; g_Controld->setVolume(tmpvol, CControld::TYPE_AVS); } else #endif m_vol_ost = false; // tell neutrino we're in audio mode CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , NeutrinoMessages::mode_audio ); // remember last mode CZapitClient::responseGetLastChannel firstchannel; g_Zapit->getLastChannel(firstchannel.channelNumber, firstchannel.mode); if ((firstchannel.mode == 'r') ? (CNeutrinoApp::getInstance()->zapto_radio_on_init_done) : (CNeutrinoApp::getInstance()->zapto_tv_on_init_done)) m_LastMode=(CNeutrinoApp::getInstance()->getLastMode() | NeutrinoMessages::norezap); else m_LastMode=(CNeutrinoApp::getInstance()->getLastMode()); // set zapit in standby mode g_Zapit->setStandby(true); // Stop sectionsd g_Sectionsd->setPauseScanning(true); #ifdef ENABLE_LIRC //Send ir CIRSend irs("esoundon"); irs.Send(); #endif puts("[esound.cpp] executing " ESOUNDSERVER_START_SCRIPT "."); if (system(ESOUNDSERVER_START_SCRIPT) != 0) perror("Datei " ESOUNDSERVER_START_SCRIPT " fehlt.Bitte erstellen, wenn gebraucht.\nFile " ESOUNDSERVER_START_SCRIPT " not found. Please create if needed.\n"); #ifdef HAVE_DBOX_HARDWARE // disable iec aka digi out g_Zapit->IecOff(); #endif printf("[esound.cpp] executing %s.\n", esound_start_command.c_str()); if (system(esound_start_command.c_str()) == 0) show(); esound_active = false; puts("[esound.cpp] stopping Esound..."); if (system("killall esd") != 0) perror("[esound.cpp] stopping Esound failed..."); // wait for esound to end sleep(2); // Restore previous background if (usedBackground) m_frameBuffer->restoreBackgroundImage(); m_frameBuffer->useBackground(usedBackground); m_frameBuffer->paintBackground(); // Restore last mode g_Zapit->setStandby(false); #if defined HAVE_DBOX_HARDWARE || defined HAVE_TRIPLEDRAGON if(m_vol_ost) { char tmpvol; tmpvol = g_Controld->getVolume(CControld::TYPE_AVS); g_Controld->setVolume(100, CControld::TYPE_AVS); g_settings.audio_avs_Control = CControld::TYPE_OST; g_Controld->setVolume(tmpvol, CControld::TYPE_OST); } #endif #ifdef ENABLE_LIRC //Send ir CIRSend irs2("esoundoff"); irs2.Send(); #endif puts("[esound.cpp] executing " ESOUNDSERVER_END_SCRIPT "."); if (system(ESOUNDSERVER_END_SCRIPT) != 0) perror("Datei " ESOUNDSERVER_END_SCRIPT " fehlt. Bitte erstellen, wenn gebraucht.\nFile " ESOUNDSERVER_END_SCRIPT " not found. Please create if needed.\n"); // Start Sectionsd g_Sectionsd->setPauseScanning(false); #ifdef HAVE_DBOX_HARDWARE // enable iec aka digi out g_Zapit->IecOn(); #endif /* Workaround for 16:9 problem Avia does reset when changing samplerate and looses the display format information, which is set to default (4:3). Therefore we set 16:9 here again if needed. */ if(g_settings.video_Format == CControldClient::VIDEOFORMAT_16_9 && g_settings.video_backgroundFormat == CControldClient::VIDEOFORMAT_16_9) g_Controld->setVideoFormat(CControldClient::VIDEOFORMAT_16_9); CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , m_LastMode ); g_RCInput->postMsg( NeutrinoMessages::SHOW_INFOBAR, 0 ); // always exit all return menu_return::RETURN_EXIT_ALL; }
static DF2(swap2){DECLF; R jt->rank?irs2(w,a,fs,jt->rank[1],jt->rank[0],f2):CALL2(f2,w,a,fs);}
static DF1(swap1){DECLF; R jt->rank?irs2(w,w,fs,jt->rank[1],jt->rank[1],f2):CALL2(f2,w,w,fs);}