// REVISAR void ListaCanciones::EliminarMediosSeleccionados(void) { unsigned int i = static_cast<unsigned int>(_ListaEx_Items.size() -1); unsigned int Z = 0; bool Parado = false; _ListaEx_UItemResaltado = NULL; _ListaEx_ItemResaltado = NULL; for (i = i; i >= 0; i--) { if (i > _ListaEx_Items.size() -1 || _ListaEx_Items.size() == 0) { if (_ListaEx_Items.size() == 0) { NombreLista = IDIOMA__LISTA_VACIA; Sistema.App.Media.Actual = -1; } else NombreLista = IDIOMA__MODIFICADA; // Lista Modificada _BarraScrollEx_MaximoV = static_cast<long>(_ListaEx_Items.size()); if ((_BarraScrollEx_MaximoV - _BarraScrollEx_PaginaV) > 0) { if (_BarraScrollEx_ValorV > _BarraScrollEx_MaximoV - _BarraScrollEx_PaginaV) _BarraScrollEx_ValorV = _BarraScrollEx_MaximoV - _BarraScrollEx_PaginaV; _ListaEx_ItemMarcado = NULL; _ListaEx_ItemShifteado = NULL; } else { _ListaEx_ItemMarcado = NULL; _ListaEx_ItemShifteado = NULL; } ActualizarTodo(); Repintar(true); if (Parado == true) { if (_ListaEx_Items.size() > 0) { if (Sistema.App.Media.Actual < 0) Sistema.App.Media.Actual = 0; Sistema.App.Media.AbrirMedio(ItemMedio(Sistema.App.Media.Actual)); Sistema.App.Media.Play(); } else { Sistema.App.Media.EliminarMedioActual(); } } return; } if (_ListaEx_Items[i]->Seleccionado() == true) { if (Sistema.App.Media.MedioActual != NULL) { if (Sistema.App.Media.MedioActual->Medio != NULL) { if (Sistema.App.Media.MedioActual->Medio == ItemMedio(i)->Medio) { Sistema.App.Media.EliminarMedioActual(); Parado = true; } } } else { Parado = true; } if (Sistema.App.Media.Actual >= static_cast<int>(i)) Sistema.App.Media.Actual --; //Sistema.App.FMod.AsignarActual(Sistema.App.FMod.Actual() -1); if (Sistema.App.Config.Shufle == true) { for (Z = 0; Z < Orig.size(); Z++) { if (Orig[Z] == ItemMedio(i)) break; } Orig.erase(Orig.begin() + Z); // Borro el puntero 'ItemListaMedios' del vector } if (ItemMedio(i)->Medio != NULL) ItemMedio(i)->Medio->Item = NULL; EliminarItem(_ListaEx_Items[i]); } } }
void ListaCanciones::MoverSeleccionAbajo(void) { ItemListaMedios *Tmp = NULL; int i; for (i = static_cast<int>(_ListaEx_Items.size()) -2; i > -1; i--) { if (_ListaEx_Items[i]->Seleccionado() == true && _ListaEx_Items[i + 1]->Seleccionado() != true) { Tmp = static_cast<ItemListaMedios *>(_ListaEx_Items[i + 1]); _ListaEx_Items[i + 1] = _ListaEx_Items[i]; _ListaEx_Items[i] = Tmp; } } for (i = 0; i < static_cast<int>(_ListaEx_Items.size()); i++) { if (_ListaEx_Items[i]->Icono() == IDI_PLAY) { Sistema.App.Media.Actual = i; break; } } // Reestructuro los nodos siguiente y anterior de la lista ReestructurarNodos(); if (_ListaEx_ItemMarcado != NULL) MostrarItem(_ListaEx_ItemMarcado); Repintar(true); }
//--------------------------------------------------------------------------- void __fastcall TForm1::BFotoClick(TObject *Sender) { char *ptr; char aux[300]; X1 = atoi(PX1->Caption.c_str()); X2 = atoi(PX2->Caption.c_str()); Y1 = atoi(PY1->Caption.c_str()); Y2 = atoi(PY2->Caption.c_str()); if(X1 > X2) { X1F = X2; X2F = X1; } else { X1F = X1; X2F = X2; } if(Y1 > Y2) { Y1F = Y2; Y2F = Y1; } else { Y1F = Y1; Y2F = Y2; } PB1->Width = NumeroColumnas + 4; PB1->Height = NumeroFilas + 4; for (int y = 0; y < NumeroFilas; y++) { for (int x = 0; x < NumeroColumnas; x++) { Foto[y][x] = 0; } } delete BM1; BM1 = new Graphics::TBitmap(); BM1->Height = NumeroFilas; BM1->Width = NumeroColumnas; BM1->PixelFormat = pf8bit; BM1->Palette = CreatePalette(&SysPal.lpal); nl = BM1->Height; numeroLineaanterior = 0; Binin = PBinin->Caption.ToInt(); Repintar(); numeroLineaanterior = 0; numeroLinea = 0; nl = numeroLinea; aux[0] = 30; nFoto++; if(nFoto >= 16) nFoto = 0; aux[1] = (nFoto << 4) & 0xF0; *(WORD*)&aux[2] = NumeroColumnas; *(WORD*)&aux[4] = NumeroFilas; if(CBT->State == cbChecked) *(BYTE*)&aux[6] = (char)Binin + 10; else *(BYTE*)&aux[6] = (char)Binin; *(WORD*)&aux[7] = (WORD)Emsg->Text.ToInt(); *(WORD*)&aux[9] = (WORD)Esg->Text.ToInt(); *(WORD*)&aux[11] = X1F; *(WORD*)&aux[13] = Y1F; *(WORD*)&aux[15] = X2F; *(WORD*)&aux[17] = Y2F; if(Sender == PCancel) *(BYTE*)&aux[19] = 1; else *(BYTE*)&aux[19] = 0; S1->Escribir(aux, 20, S1->IPRabbit); TFoto = GetTickCount(); if(Sender == PCancel) { LeyendoFoto = false; PFoto->BevelOuter = bvRaised; PFoto->Color = clSilver; IFoto->Picture->Bitmap->LoadFromResourceName((int)HInstance, "FOTO"); SLedFoto->Brush->Color = clGray; TBBinin->Enabled = true; } else if(Sender == PFoto) { LeyendoFoto = true; PFoto->BevelOuter = bvLowered; PFoto->Color = (TColor)0x00DEDEDE; IFoto->Picture->Bitmap->LoadFromResourceName((int)HInstance,"CLICK"); SLedFoto->Brush->Color = clRed; TBBinin->Enabled = false; } }
//--------------------------------------------------------------------------- void __fastcall TForm1::Timer1Timer(TObject *Sender) { char *ptr; char aux[300]; static char cfs[50] = " "; int aa; TColor col[2] = {clGray, clRed}; TColor col1[2] = {clGray, clLime}; PRABBIT->Caption = " Rabbit: " + AnsiString(S1->cadenaIPRabbit); if(S1->PerdidaConexion == true) { EstadoRabbit = " Rabbit no responde"; ColorEstado = clRed; } else { EstadoRabbit = AnsiString(" Rabbit ") + AnsiString(S1->cadenaIPRabbit); ColorEstado = clLime;//clBlack; if(S1->nDatosRabbit >= 17) { S1->LeerRabbit(aux, 100); aux[18] = 0; Panel1->Caption = aux; } if(S1->nDatosCFS > 0) { aa = S1->nDatosCFS; S1->LeerCFS(aux, 50); for(int kk = 0; kk < aa; kk++) { for(int pp = 0; pp < 48; pp++) { cfs[pp] = cfs[pp + 1]; } cfs[48] = aux[kk]; AnalizarCFS(aux[kk]); } cfs[49] = 0; PCFS->Caption = cfs; } if(S1->nDatosLX200 > 0) { } } if(EstadoRabbit != EstadoAnterior) { EstadoAnterior = EstadoRabbit; PStatus->Font->Color = ColorEstado; //PStatus->Caption = EstadoRabbit; SC->Brush->Color = ColorEstado; } // if(numeroLinea < 0) // return; if(LeyendoFoto == true) { if(LineaNueva == true) { LineaNueva = false; SLedFoto->Brush->Color = clLime; SLedFoto->Repaint(); nl = numeroLinea; Repintar(); } else { if(PFoto->BevelOuter == bvLowered) { if(SLedFoto->Brush->Color != clRed) { SLedFoto->Brush->Color = clRed; SLedFoto->Repaint(); } } } if((nl >= Y2F))/* || (GetTickCount() >= TFoto + Esg->Text.ToInt() * 1000 + Emsg->Text.ToInt() + 5000))*/ { if(PFoto->BevelOuter == bvLowered) { PFoto->BevelOuter = bvRaised; PFoto->Color = clSilver; SLedFoto->Brush->Color = clGray; SLedFoto->Repaint(); IFoto->Picture->Bitmap->LoadFromResourceName((int)HInstance, "FOTO"); LeyendoFoto = false; } } } Sbit1->Brush->Color = col[Salidas & 0x01]; Sbit2->Brush->Color = col[(Salidas & 0x02) >> 1]; Sbit3->Brush->Color = col[(Salidas & 0x04) >> 2]; Sbit4->Brush->Color = col[(Salidas & 0x08) >> 3]; Sbit5->Brush->Color = col[(Salidas & 0x10) >> 4]; Sbit6->Brush->Color = col[(Salidas & 0x20) >> 5]; Sbit7->Brush->Color = col[(Salidas & 0x40) >> 6]; Sbit8->Brush->Color = col[(Salidas & 0x80) >> 7]; ss1->Brush->Color = col1[Grupos[0] & 0x01]; ss2->Brush->Color = col1[(Grupos[0] & 0x02) >> 1]; ss3->Brush->Color = col1[(Grupos[0] & 0x04) >> 2]; ss4->Brush->Color = col1[(Grupos[0] & 0x08) >> 3]; ss5->Brush->Color = col1[(Grupos[0] & 0x10) >> 4]; ss6->Brush->Color = col1[(Grupos[0] & 0x20) >> 5]; ss7->Brush->Color = col1[Grupos[1] & 0x01]; ss8->Brush->Color = col1[(Grupos[1] & 0x02) >> 1]; ss9->Brush->Color = col1[(Grupos[1] & 0x04) >> 2]; ss10->Brush->Color = col1[(Grupos[1] & 0x08) >> 3]; ss11->Brush->Color = col1[(Grupos[1] & 0x10) >> 4]; ss12->Brush->Color = col1[(Grupos[1] & 0x20) >> 5]; ss13->Brush->Color = col1[Grupos[2] & 0x01]; ss14->Brush->Color = col1[(Grupos[2] & 0x02) >> 1]; ss15->Brush->Color = col1[(Grupos[2] & 0x04) >> 2]; ss16->Brush->Color = col1[(Grupos[2] & 0x08) >> 3]; ss17->Brush->Color = col1[(Grupos[2] & 0x10) >> 4]; ss18->Brush->Color = col1[(Grupos[2] & 0x20) >> 5]; ss19->Brush->Color = col1[Grupos[3] & 0x01]; ss20->Brush->Color = col1[(Grupos[3] & 0x02) >> 1]; ss21->Brush->Color = col1[(Grupos[3] & 0x04) >> 2]; ss22->Brush->Color = col1[(Grupos[3] & 0x08) >> 3]; ss23->Brush->Color = col1[(Grupos[3] & 0x10) >> 4]; ss24->Brush->Color = col1[(Grupos[3] & 0x20) >> 5]; }
void ListaCanciones::Shufle(const bool sShufle) { unsigned int i; unsigned int R; Sistema.App.PlayerEx.BotonShufleRepeat.ShufleMarcado(sShufle); Sistema.App.ControlesMP.BotonShufleRepeat.ShufleMarcado(sShufle); if (_ListaEx_Items.size() == 0) { Sistema.App.Config.Shufle = sShufle; // Cambio los iconos if (sShufle == true) { Sistema.App.PlayerEx.MenuShufle->Menu(0)->Icono(IDI_MARCA_MENU); Sistema.App.PlayerEx.MenuShufle->Menu(1)->Icono(NULL); } else { Sistema.App.PlayerEx.MenuShufle->Menu(0)->Icono(NULL); Sistema.App.PlayerEx.MenuShufle->Menu(1)->Icono(IDI_MARCA_MENU); } return; } if (sShufle == true) { // Mezclar la lista if (Sistema.App.Config.Shufle == false || Orig.size() == 0) { // Guardo el Orden original de las canciones Orig.clear(); for (i = 0; i < _ListaEx_Items.size(); i++) { Orig.push_back(ItemMedio(i)); } // Mezclo los BDItems } for (i = 0; i < _ListaEx_Items.size(); i++) _ListaEx_Items[i] = NULL; i = 0; while (i < _ListaEx_Items.size()) { R = static_cast<unsigned int>(rand()%_ListaEx_Items.size()); while (_ListaEx_Items[R] != NULL) { R++; if (R == _ListaEx_Items.size()) R = 0; } _ListaEx_Items[R] = Orig[i]; // ha petat un cop, i el vector orig era nomes de 3 espais mentres que el de items era de 8.... molt chungo, s'ha de revisar i probar be. i++; } } else { // Restaurar orden de la lista for (i = 0; i < _ListaEx_Items.size(); i++) _ListaEx_Items[i] = Orig[i]; } TMedio *bMedio = NULL; if (Sistema.App.Media.MedioActual != NULL) { if (Sistema.App.Media.MedioActual->Medio != NULL) { bMedio = Sistema.App.Media.MedioActual->Medio; for (i = 0; i < _ListaEx_Items.size(); i++) { if (bMedio == ItemMedio(i)->Medio) { switch (Sistema.App.Media.ComprobarEstado()) { case EnPlay : _ListaEx_Items[i]->Icono(IDI_PLAY, false); break; case EnPausa : _ListaEx_Items[i]->Icono(IDI_PAUSA, false); break; case EnStop : if (ItemMedio(i)->Medio->TipoMedio == Tipo_Medio_Audio) _ListaEx_Items[i]->Icono(Sistema.App.BD.MiraIconoCancion(ItemMedio(i)->Medio->Reproducido), false); else _ListaEx_Items[i]->Icono(Sistema.App.BD.MiraIconoVideo(ItemMedio(i)->Medio->Reproducido), false); break; } Sistema.App.Media.Actual = i; } else { if (ItemMedio(i)->Medio->TipoMedio == Tipo_Medio_Audio) _ListaEx_Items[i]->Icono(Sistema.App.BD.MiraIconoCancion(ItemMedio(i)->Medio->Reproducido), false); else _ListaEx_Items[i]->Icono(Sistema.App.BD.MiraIconoVideo(ItemMedio(i)->Medio->Reproducido), false); } } } } // Reestructuro los nodos siguiente y anterior de la lista ReestructurarNodos(); Sistema.App.Config.Shufle = sShufle; Repintar(true); // Cambio los iconos if (sShufle == true) { Sistema.App.PlayerEx.MenuShufle->Menu(0)->Icono(IDI_MARCA_MENU); Sistema.App.PlayerEx.MenuShufle->Menu(1)->Icono(NULL); } else { Sistema.App.PlayerEx.MenuShufle->Menu(0)->Icono(NULL); Sistema.App.PlayerEx.MenuShufle->Menu(1)->Icono(IDI_MARCA_MENU); } }